-
-
Notifications
You must be signed in to change notification settings - Fork 200
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
Deprecate definition of job priority, change to "smaller number is higher priority" to align with Active Job definition #883
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for the swift follow up!!
9add25f
to
76b8fb9
Compare
76b8fb9
to
f0ab63d
Compare
…gher priority" to align with Active Job definition.
f0ab63d
to
c35f852
Compare
@bensheldon, does this also affect the index on In an existing app (with migrations from prior to this change), I have this index: add_index :good_jobs, [:priority, :created_at], order: { priority: "DESC NULLS LAST", created_at: :asc }, Does that need to become Apologies if this is a dupe and this was already on your radar. |
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.
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.
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.
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.
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.
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.
…1213) The preexisting index (introduced in #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 #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.
* Update gem * Generate and run GoodJob migrations * Switch to Active Job's priority convention See bensheldon/good_job#883 * FIx spec on priority * Ignore GoodJob migrations in Rubocop * Re-add safety_assured that was wiped when regenerating migrations
Reported in #524 (comment).
Active Job describes priority as "lower is more priority".