[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

@@ -75,13 +75,18 @@ type Database struct {
}
func NewDatabase() *Database {
return &Database{
File: NewFileStore(),
Folder: NewFolderStore(),
Image: NewImageStore(),
Gallery: NewGalleryStore(),
Scene: NewSceneStore(),
fileStore := NewFileStore()
folderStore := NewFolderStore()
ret := &Database{
File: fileStore,
Folder: folderStore,
Scene: NewSceneStore(fileStore),
Image: NewImageStore(fileStore),
Gallery: NewGalleryStore(fileStore, folderStore),
}
return ret
}
// Ready returns an error if the database is not ready to begin transactions.