Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sequential Scans / Missing indexes? #380

Open
pglombardo opened this issue Oct 10, 2024 · 2 comments
Open

Sequential Scans / Missing indexes? #380

pglombardo opened this issue Oct 10, 2024 · 2 comments

Comments

@pglombardo
Copy link

I'm happily using Solid queue in pwpush.com and the OSS project.

While investigating sequential scans I found this:

Screenshot 2024-10-10 at 13 21 07

Postgres backend. You can gather this info with the following DB query in rails dbconsole:

SELECT relname AS table_name,
       seq_scan,
       idx_scan
FROM pg_stat_user_tables
ORDER BY seq_scan DESC;

This project was originally at v0.3 and now v1.0 - all steps/migrations run. No production issues - everything runs smoothly. Only the minor issue above.

@rosa
Copy link
Member

rosa commented Oct 28, 2024

Hey @pglombardo, thanks for writing this up! The reason for this is that PostgreSQL doesn't implement a technique called "loose index scan", which is what MySQL uses to allow for DISTINCT type queries on indexed columns, and which are performed on solid_queue_ready_executions if you have either paused queues or prefixes in your workers configuration (such as queues: beta*). Usually the ready_executions table should be small so these shouldn't be very problematic, but depending on your load, the number of queues and configuration, it might be noticeable. I need to document this better in the README. How do you have your queues configured?

@pglombardo
Copy link
Author

This is a great explanation and much appreciated. Solid Queue is running smoothly for me. I just noticed this while investigating other issues. We can close this issue then. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants