mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
[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:
@@ -51,6 +51,7 @@ func Test_galleryQueryBuilder_Create(t *testing.T) {
|
||||
SceneIDs: []int{sceneIDs[sceneIdx1WithPerformer], sceneIDs[sceneIdx1WithStudio]},
|
||||
TagIDs: []int{tagIDs[tagIdx1WithScene], tagIDs[tagIdx1WithDupName]},
|
||||
PerformerIDs: []int{performerIDs[performerIdx1WithScene], performerIDs[performerIdx1WithDupName]},
|
||||
Files: []file.File{},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@@ -202,9 +203,12 @@ func Test_galleryQueryBuilder_Update(t *testing.T) {
|
||||
Files: []file.File{
|
||||
makeGalleryFileWithID(galleryIdxWithImage),
|
||||
},
|
||||
Organized: true,
|
||||
CreatedAt: createdAt,
|
||||
UpdatedAt: updatedAt,
|
||||
SceneIDs: []int{},
|
||||
TagIDs: []int{},
|
||||
PerformerIDs: []int{},
|
||||
Organized: true,
|
||||
CreatedAt: createdAt,
|
||||
UpdatedAt: updatedAt,
|
||||
},
|
||||
false,
|
||||
},
|
||||
@@ -215,9 +219,12 @@ func Test_galleryQueryBuilder_Update(t *testing.T) {
|
||||
Files: []file.File{
|
||||
makeGalleryFileWithID(galleryIdxWithScene),
|
||||
},
|
||||
Organized: true,
|
||||
CreatedAt: createdAt,
|
||||
UpdatedAt: updatedAt,
|
||||
SceneIDs: []int{},
|
||||
TagIDs: []int{},
|
||||
PerformerIDs: []int{},
|
||||
Organized: true,
|
||||
CreatedAt: createdAt,
|
||||
UpdatedAt: updatedAt,
|
||||
},
|
||||
false,
|
||||
},
|
||||
@@ -228,9 +235,12 @@ func Test_galleryQueryBuilder_Update(t *testing.T) {
|
||||
Files: []file.File{
|
||||
makeGalleryFileWithID(galleryIdxWithTag),
|
||||
},
|
||||
Organized: true,
|
||||
CreatedAt: createdAt,
|
||||
UpdatedAt: updatedAt,
|
||||
SceneIDs: []int{},
|
||||
TagIDs: []int{},
|
||||
PerformerIDs: []int{},
|
||||
Organized: true,
|
||||
CreatedAt: createdAt,
|
||||
UpdatedAt: updatedAt,
|
||||
},
|
||||
false,
|
||||
},
|
||||
@@ -241,9 +251,12 @@ func Test_galleryQueryBuilder_Update(t *testing.T) {
|
||||
Files: []file.File{
|
||||
makeGalleryFileWithID(galleryIdxWithPerformer),
|
||||
},
|
||||
Organized: true,
|
||||
CreatedAt: createdAt,
|
||||
UpdatedAt: updatedAt,
|
||||
SceneIDs: []int{},
|
||||
TagIDs: []int{},
|
||||
PerformerIDs: []int{},
|
||||
Organized: true,
|
||||
CreatedAt: createdAt,
|
||||
UpdatedAt: updatedAt,
|
||||
},
|
||||
false,
|
||||
},
|
||||
@@ -428,6 +441,9 @@ func Test_galleryQueryBuilder_UpdatePartial(t *testing.T) {
|
||||
Files: []file.File{
|
||||
makeGalleryFile(galleryIdxWithImage),
|
||||
},
|
||||
SceneIDs: []int{},
|
||||
TagIDs: []int{},
|
||||
PerformerIDs: []int{},
|
||||
},
|
||||
false,
|
||||
},
|
||||
@@ -621,7 +637,9 @@ func Test_galleryQueryBuilder_UpdatePartialRelationships(t *testing.T) {
|
||||
Mode: models.RelationshipUpdateModeRemove,
|
||||
},
|
||||
},
|
||||
models.Gallery{},
|
||||
models.Gallery{
|
||||
SceneIDs: []int{},
|
||||
},
|
||||
false,
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user