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

Improve DISTINCT query for finding queue names in PostgreSQL #397

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bubiche
Copy link

@bubiche bubiche commented Oct 29, 2024

workerB

Related issue in Mission Control: rails/mission_control-jobs#160

We use SolidQueue with PostgreSQL and sometimes viewing Mission Control slows the database down due to the SELECT DISTINCT query. The discussion in the linked issue suggests using recursive CTE, which seems to have better performance in practice for us.

This PR uses recursive CTE for PostgreSQL if it is supported for better performance.

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

Successfully merging this pull request may close these issues.

1 participant