Drop the index hint from the auto-postpone sweep#2973
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the forced MySQL optimizer index hint from the hourly card auto-postpone (entropy) sweep, relying on the optimizer to choose the appropriate plan now that statistics for the (account_id, board_id, status) index have stabilized. This keeps the underlying index (added in #2970) while reducing hardcoded query-plan coupling in background processing.
Changes:
- Removes the
.use_index(:index_cards_on_account_id_and_board_id_and_status)hint fromCard::Entropic.auto_postpone_all_due. - Removes the now-obsolete explanatory comment describing why the hint was pinned.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes the
use_indexpin fromCard::Entropic.auto_postpone_all_due, keeping the(account_id, board_id, status)index added in #2970.Once MySQL collected statistics on the new index, the planner started choosing it for the sweep on its own. The forced pin is no longer needed and is better left to the planner, which can adapt per-account as data shifts — a background sweep doesn't warrant a hardcoded plan.
The index stays; only the hint is removed.