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

Improve performance of gallery and image queries #2422

Merged
merged 3 commits into from
Mar 25, 2022

Conversation

WithoutPants
Copy link
Collaborator

Fixes #2347

Reverts to use FindByGalleryID for gallery image queries. Changed the query string to use an inner join, which is faster.

Optimised the getMultiCriterionClause to utilise the join table is present.

This addresses a performance regression introduced in the dev branch, and a latent performance issue for findImages.

On my contrived database with 4m images, it reduced the load time for findImages from 5.5s to 123ms. findGalleries wasn't returning at all.

@WithoutPants WithoutPants added the improvement Something needed tweaking. label Mar 24, 2022
@WithoutPants WithoutPants added this to the Version 0.14.0 milestone Mar 24, 2022
@kermieisinthehouse
Copy link
Collaborator

Galleries load faster on my database, from many seconds to under one second. Accessing the images view still takes ~15 seconds, regardless of sort

@WithoutPants WithoutPants merged commit f581687 into stashapp:develop Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Something needed tweaking.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

findImages seems to have some performance issues
3 participants