-
-
Notifications
You must be signed in to change notification settings - Fork 785
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
Move image blobs into separate tables #618
Merged
WithoutPants
merged 10 commits into
stashapp:develop
from
WithoutPants:image_performance
Jun 22, 2020
Merged
Move image blobs into separate tables #618
WithoutPants
merged 10 commits into
stashapp:develop
from
WithoutPants:image_performance
Jun 22, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bnkai
reviewed
Jun 18, 2020
Thanks for the heads up. I've since tested against some movies and fixed an unrelated issue that movie studios were not being exported or imported. |
WithoutPants
added a commit
that referenced
this pull request
Jun 22, 2020
Tweeticoats
pushed a commit
to Tweeticoats/stash
that referenced
this pull request
Feb 1, 2021
* Scene cover fallback to database * Fix panic if studio not found * Fix movie studio not being imported/exported
Tweeticoats
pushed a commit
to Tweeticoats/stash
that referenced
this pull request
Feb 1, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Moves all images into separate tables:
cover
intoscenes_cover
image
intoperformers_image
image
intostudios_image
front_image
/back_image
intomovies_images
The performance gain is potentially quite large. On a database with ~1000 scenes, all with covers, the following graphql query went from 6.39 seconds to 477ms!
graphql query in question (tested using graphql playground):
This required a schema migration that essentially rebuilds the entire schema, since removing columns requires rebuilding both the table and referencing tables. As such, I have performed the following verification steps to ensure there is no loss of data:
.schema
on the before and after databases and compared the results to ensure no fields or indexes were lostThe only part that hasn't been exercised by this is movies, since the database I was using didn't have them. I will test that in the meantime.
Other changes:
utils.ServeImage
which performs the etag generation added previous and applies to all database imagesBox.Bytes
toBox.Find
to eliminate the deprecation messageOther things to consider:
front_image
Resolves #425