Open LZRS opened 2 weeks ago
Hi @LZRS thanks for this draft PR - this is really important!
Some comments on the draft PR: it would be much easier to review smaller changes because this touches so many tables - maybe we can have 1 pr to change the indices and another one to change the queries.
secondly, can you use query planner in android studio to check if the indices are being hit? and do you have actual numbers with regards to time taken for these queries?
Okay, I will do that and share some of the related query plans
based on https://www.sqlite.org/queryplanner.html#_multi_column_indices and https://www.sqlite.org/optoverview.html
IMPORTANT: All PRs must be linked to an issue (except for extremely trivial and straightforward changes).
Fixes #[issue number]
Description Refactor db covering indexes to have their leftmost columns to be those most likely to be unique (also mostly likely to be used) Based on https://www.sqlite.org/queryplanner.html#_multi_column_indices
And https://www.sqlite.org/optoverview.html
Alternative(s) considered Have you considered any alternatives? And if so, why have you chosen the approach in this PR?
Type Choose one: (Bug fix | Feature | Documentation | Testing | Code health | Builds | Releases | Other)
Screenshots (if applicable)
Checklist
./gradlew spotlessApply
and./gradlew spotlessCheck
to check my code follows the style guide of this project../gradlew check
and./gradlew connectedCheck
to test my changes locally.