mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Query optimizations (#478)
* Remove slow and largely pointless groupbys * Change scene.query to use querybuilder
This commit is contained in:
@@ -93,7 +93,7 @@ func (qb *GalleryQueryBuilder) FindByPath(path string) (*Gallery, error) {
|
||||
}
|
||||
|
||||
func (qb *GalleryQueryBuilder) FindBySceneID(sceneID int, tx *sqlx.Tx) (*Gallery, error) {
|
||||
query := "SELECT galleries.* FROM galleries JOIN scenes ON scenes.id = galleries.scene_id WHERE scenes.id = ? LIMIT 1"
|
||||
query := "SELECT galleries.* FROM galleries WHERE galleries.scene_id = ? LIMIT 1"
|
||||
args := []interface{}{sceneID}
|
||||
return qb.queryGallery(query, args, tx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user