I've mentioned it before¹, but just in case you haven't seen it: the sqlite3 command line utility contains a `.expert` tool² (a.k.a. dot command) which uses the ext/expert/ internals³ to analyze a query and database statistics to offer recommendations about creating indices⁴ that would speed up the query.
Useful tuning tool, *superb* learning tool.
¹: https://mastodon.social/@gnomon/116942215013530944
²: https://sqlite.org/cli.html#index_recommendations_sqlite_expert_
³: https://sqlite.org/src/dir?ci=trunk&name=ext/expert
⁴: or "indexes", if you prefer, for future text searchability

