[Files Refactor] Performance tuning (#2813)

* Do database txn in same thread. Retry on locked db
* Remove captions from slimscenedata
* Fix tracing
* Use where in instead of individual selects
* Remove scenes_query view
* Remove image query view
* Remove gallery query view
* Use where in for FindMany
* Don't interrupt scanning zip files
* Fix image filesize sort
This commit is contained in:
WithoutPants
2022-08-11 16:14:57 +10:00
parent 87167736f6
commit 9b31b20fed
19 changed files with 715 additions and 680 deletions

View File

@@ -250,12 +250,6 @@ func (r *fileQueryRow) appendRelationships(i *file.BaseFile) {
}
}
func mergeFiles(dest file.File, src file.File) {
if src.Base().Fingerprints != nil {
dest.Base().Fingerprints = appendFingerprintsUnique(dest.Base().Fingerprints, src.Base().Fingerprints...)
}
}
type fileQueryRows []fileQueryRow
func (r fileQueryRows) resolve() []file.File {
@@ -279,11 +273,6 @@ func (r fileQueryRows) resolve() []file.File {
return ret
}
type relatedFileQueryRow struct {
fileQueryRow
Primary null.Bool `db:"primary"`
}
type FileStore struct {
repository