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

Add an index to better support smaller_number_is_higher_priority #1213

Merged

Commits on Jan 14, 2024

  1. Add an index to better support smaller_number_is_higher_priority

    The preexisting index (introduced in bensheldon#726) gave a direct answer to the
    materialized subquery used to find candidate jobs, subject to the ordering rules
    that were in place at that time.  In bensheldon#883, `GoodJob` deprecated that ordering in
    favour of a lower-is-more-important scheme, aligning with Active Job.
    
    When there are a substantial number of completed jobs, the `priority desc` index
    does not allow for a straight index scan, and may not actually be used by the
    planner.  Aligning the sort orders here allows for the subquery to be satisfied
    directly.
    
    Although `ASC NULLS LAST` is the default (as observable in the generated schema)
    it seems appropriate to be explicit in the actual index declaration, although
    mostly for consistency with the previous version.
    mkrfowler committed Jan 14, 2024
    Configuration menu
    Copy the full SHA
    38a4f49 View commit details
    Browse the repository at this point in the history