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

Replace jobs_user_guid_index with jobs_user_guid_state_index #3934

Merged

Commits on Aug 20, 2024

  1. Replace jobs_user_guid_index with jobs_user_guid_state_index

    When the jobs table is large and single users have also a large amount of jobs, which are mostly in state `COMPLETED`,
    postgres might decide to not use the index on `user_guid` column and scan the table with other methods, which are much slower.
    This commit removes the index on user_guid column and adds a new partial index on user_guid and state where state is either
    `POLLING` or `PROCESSING`. This keeps the index much smaller and improves the query performance drastically.
    
    MySQL does not support partial indexes.
    svkrieger committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    6c7c13a View commit details
    Browse the repository at this point in the history