Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The SQLite CLI has a `.expert` command that will give index recommendations when you run queries: https://sqlite.org/cli.html#index_recommendations_sqlite_exp...

It's not quite the same as capturing all of the queries used in development (or production), but it seems somewhat useful.

I'll also note that I had an LLM generate quite a useful script to identify unused indexes (it scanned the code base for SQL queries, ran `EXPLAIN QUERY PLAN` on each one to identify which indexes were being used, and cross-referenced that against the indexes in the database to find unused ones). It would probably be possible to do something similar (but definitely imperfect) where you find all of the queries, get the query plans, and use an LLM to make suggestions about what indexes would speed up those queries.



wow!

I used to bruteforce a bunch of indexes until EXPLAIN on queries gave satisfactory results!

I actually looked for a tool where I could provide a schema and all queries to get optimal indexes but never found one that actually worked.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: