-
Notifications
You must be signed in to change notification settings - Fork 513
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
Migration indexes #3536
Migration indexes #3536
Conversation
After some more attempts, I have been unable to find additional indices to speed up the selects on each book. I think that is just related to how many columns are being loaded. I looked at adding indices for
|
I think that when we can start improving the API the queries will be simpler and it will be easier to write indexes for them. That data is really helpful, thanks for pulling that. Thanks! |
This PR fixes #3259, #3525, and #3237.
This PR adds migrations for the following indices:
BookAuthor
onauthorId
BookSeries
onseriesId
PodcastEpisode
oncreatedAt
andpodcastId
from Add podcastId index to podcastEpisodes #3528The author and series indexes reduce query time from multiple seconds/minutes for large databases (more than 20k items) to less than a second. I have not done much testing with large podcast databases yet. I am still investigating why some of the select book queries did not improve too much and whether this can be solved by another index.
To test the difference in query time, I did the following on a moderately sized database so the loop ran in a reasonable amount of time.
Database stats:
I sorted the times by the runtime without indexes, and created the following table (did not include all sets of indexes being added to show best/worst case):