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

Add podcastId index to podcastEpisodes #3528

Closed
wants to merge 1 commit into from
Closed

Conversation

drwggm
Copy link

@drwggm drwggm commented Oct 17, 2024

I have roughly 40k podcast episodes on around 200 podcasts, and performance was becoming an issue. I noticed the only index on podcastEpisodes was createdAt. Since joins are frequently done between podcasts and podcastEpisodes this will slow things down quite a bit without an index. There is a foreign key constraint, but AFAIK sqlite3 does not create an index for FKs automatically.

This change adds an index on podcastEpisodes.podcastId. It improves performance (loading time) for me on the /library/......, /library/.../bookshelf, and /library/...../podcast/latest webpages

I am not a JS dev. I looked through the migration code, and it seems like the addition of an index should migrate, but I am unsure.

Feel free to ask questions, or I'm on discord too (mggw)

@nichwall
Copy link
Contributor

Would you be able to send me a copy of your database? I was working on putting together a migration with several different new indexes, but I don't have too many podcasts (only about 600 episodes total) for testing various combinations of indexes.

I can just include the createdAt and podcastId but want to try some more.

@nichwall nichwall mentioned this pull request Oct 19, 2024
@advplyr
Copy link
Owner

advplyr commented Oct 19, 2024

We decided it was better to modify indexes in a migration and this was done here #3536

@advplyr advplyr closed this Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants