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

DB Analyzer: Sort unused indexes by some heuristics #2423

Open
ankush opened this issue Jan 15, 2025 · 2 comments
Open

DB Analyzer: Sort unused indexes by some heuristics #2423

ankush opened this issue Jan 15, 2025 · 2 comments
Assignees

Comments

@ankush
Copy link
Member

ankush commented Jan 15, 2025

Framework auto indexes a few things. Some of these indexes are unused because the user isn't actually using those doctypes OR usage is not that frequent (like closing balance).

Currently, I have 1000+ index removal recommendations. IMO most of these recommendations are not actionable.

Image

Simplest fix:

  • Use table schema information, don't recommend index that are < 16MB in size.
  • If index size isn't easy to fetch then use table size as a proxy, don't recommend tables that have <256MB size.
  • Limit recommendations to 100 max after sorting.
  • Those numbers are made up, but assuming modern machines with 20-60MB L3 cache, that data size is peanuts and not worth optimizing.
@ankush
Copy link
Member Author

ankush commented Jan 15, 2025

@tanmoysrt

@ankush
Copy link
Member Author

ankush commented Jan 15, 2025

Apply similar heuristics on redundant index too, sort by "impact"

Image

@tanmoysrt tanmoysrt self-assigned this Jan 15, 2025
@tanmoysrt tanmoysrt moved this to Todo in Database Roadmap Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants