Skip to content

Closes #18191: Remove duplicate SQL indexes #19074

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

Merged
merged 3 commits into from
Apr 3, 2025

Conversation

jeremystretch
Copy link
Member

@jeremystretch jeremystretch commented Apr 3, 2025

Fixes: #18191

  • Remove the redundant index declarations from each model
  • Generate migrations
  • Add a note in the developer documentation
  • Introduce a Django system check for duplicate indexes

Note: I did also perform an audit for any additional redundant indexes, but did not uncover any that weren't already listed in #18191.

@jeremystretch jeremystretch requested review from a team and jnovinger and removed request for a team April 3, 2025 18:37
@jeremystretch jeremystretch marked this pull request as draft April 3, 2025 18:47
@jeremystretch
Copy link
Member Author

I forgot; we wanted to look into adding a check for duplicate indexes as well. Let me dig into that.

@jeremystretch jeremystretch marked this pull request as ready for review April 3, 2025 19:10


@register(Tags.models)
def check_duplicate_indexes(app_configs, **kwargs):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍 I honestly think it is worth checking if Django is interested in having this or something like this.

@jnovinger jnovinger merged commit 67480dc into feature Apr 3, 2025
6 checks passed
@jeremystretch jeremystretch deleted the 18191-remove-duplicate-indexes branch April 3, 2025 23:15
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants