stash/pkg/sqlite
WithoutPants 0fd7a2ac20
SQL performance improvements (#6378)
* Change queryStruct to use tx.Get instead of queryFunc

Using queryFunc meant that the performance logging was inaccurate due to the query actually being executed during the call to Scan.

* Only add join args if join was added

* Omit joins that are only used for sorting when skipping sorting

Should provide some marginal improvement on systems with a lot of items.

* Make all calls to the database pass context.

This means that long queries can be cancelled by navigating to another page. Previously the query would continue to run, impacting on future queries.
2025-12-08 08:08:31 +11:00
..
blob Developer option: extra blob paths (#4566) 2024-02-16 12:39:45 +11:00
migrations Feature: Tag StashID support (#6255) 2025-11-13 14:24:09 +11:00
anonymise.go Feature: Tag StashID support (#6255) 2025-11-13 14:24:09 +11:00
anonymise_test.go Add anonymise database task (#3186) 2022-12-23 09:15:27 +11:00
batch.go Add findFiles and findFile graphql queries (#5941) 2025-06-24 13:05:17 +10:00
blob.go Add related object filter criteria to various filter types in graphql schema (#4861) 2024-06-11 11:34:38 +10:00
blob_migrate.go Add filesystem based blob storage (#3187) 2023-03-17 10:52:49 +11:00
blob_test.go Movie group renames (#5039) 2024-07-04 09:10:26 +10:00
common.go File storage rewrite (#2676) 2022-09-06 07:03:42 +00:00
criterion_handlers.go Related files/folder filter for scenes/images/galleries (#6158) 2025-11-06 17:25:59 +11:00
custom_fields.go Add support for removing custom field keys (#6362) 2025-12-04 07:28:06 +11:00
custom_fields_test.go Add support for removing custom field keys (#6362) 2025-12-04 07:28:06 +11:00
custom_migrations.go File storage rewrite (#2676) 2022-09-06 07:03:42 +00:00
database.go Feature: Tag StashID support (#6255) 2025-11-13 14:24:09 +11:00
date.go SQLite model refactoring, part 2 (#3839) 2023-07-13 12:15:02 +10:00
doc.go Add package docs and project vision/goals (#5169) 2024-08-28 09:01:39 +10:00
driver.go Sort special characters before numbers (#3829) 2023-06-22 09:51:21 +10:00
file.go Handle modified files where the case of the filename changed on case-insensitive filesystems (#6327) 2025-12-02 12:53:37 +11:00
file_filter.go Related files/folder filter for scenes/images/galleries (#6158) 2025-11-06 17:25:59 +11:00
file_filter_test.go Add findFolder and findFolders queries to graphql schema (#5965) 2025-06-26 15:48:29 +10:00
file_test.go Handle modified files where the case of the filename changed on case-insensitive filesystems (#6327) 2025-12-02 12:53:37 +11:00
filter.go SQL performance improvements (#6378) 2025-12-08 08:08:31 +11:00
filter_hierarchical.go Containing Group/Sub-Group relationships (#5105) 2024-08-30 11:43:44 +10:00
filter_internal_test.go Restructure data layer (#2532) 2022-09-06 07:03:40 +00:00
fingerprint.go Support setting file fingerprints (#4376) 2023-12-22 14:07:10 +11:00
folder.go Handle modified files where the case of the filename changed on case-insensitive filesystems (#6327) 2025-12-02 12:53:37 +11:00
folder_filter.go Related files/folder filter for scenes/images/galleries (#6158) 2025-11-06 17:25:59 +11:00
folder_filter_test.go Add findFolder and findFolders queries to graphql schema (#5965) 2025-06-26 15:48:29 +10:00
folder_test.go Handle modified files where the case of the filename changed on case-insensitive filesystems (#6327) 2025-12-02 12:53:37 +11:00
functions.go Correct title ordering for objects without titles (#3244) 2022-12-09 08:29:34 +11:00
gallery.go SQL performance improvements (#6378) 2025-12-08 08:08:31 +11:00
gallery_chapter.go Use slices package from the stdlib when possible (#5360) 2024-10-29 11:26:23 +11:00
gallery_chapter_test.go SQLite model refactoring (#3791) 2023-06-15 12:46:09 +10:00
gallery_filter.go Related files/folder filter for scenes/images/galleries (#6158) 2025-11-06 17:25:59 +11:00
gallery_test.go Fix tag order on details pages (#6143) 2025-10-16 13:15:09 +11:00
group.go SQL performance improvements (#6378) 2025-12-08 08:08:31 +11:00
group_filter.go Group O-Counter Filter/Sort (#6122) 2025-11-10 11:53:53 +11:00
group_relationships.go Containing Group/Sub-Group relationships (#5105) 2024-08-30 11:43:44 +10:00
group_test.go Use slices package from the stdlib when possible (#5360) 2024-10-29 11:26:23 +11:00
history.go Scene play and o-counter history view and editing (#4532) 2024-02-22 11:28:18 +11:00
image.go SQL performance improvements (#6378) 2025-12-08 08:08:31 +11:00
image_filter.go Related files/folder filter for scenes/images/galleries (#6158) 2025-11-06 17:25:59 +11:00
image_test.go Add group graphql interfaces (#5017) 2024-07-03 13:59:40 +10:00
migrate.go Fix various migration issues (#5723) 2025-03-19 08:04:21 +11:00
performer.go Feature: Filter by Total Scene Duration (#6172) 2025-11-10 10:45:36 +11:00
performer_filter.go feat: Add Performers tab to Group detail page (#5895) 2025-06-11 17:07:09 +10:00
performer_test.go Fix tag order on details pages (#6143) 2025-10-16 13:15:09 +11:00
phash.go Phash distance filter (#3596) 2023-04-17 15:36:51 +10:00
query.go SQL performance improvements (#6378) 2025-12-08 08:08:31 +11:00
record.go Scene play and o-counter history view and editing (#4532) 2024-02-22 11:28:18 +11:00
regex.go Update a number of dependencies (incl. CVE fixes) (#4107) 2023-10-26 16:24:32 +11:00
relationships.go Movie/Group tags (#4969) 2024-06-18 11:24:15 +10:00
repository.go SQL performance improvements (#6378) 2025-12-08 08:08:31 +11:00
saved_filter.go Use slices package from the stdlib when possible (#5360) 2024-10-29 11:26:23 +11:00
saved_filter_test.go Default view filters (#4962) 2024-06-18 10:51:52 +10:00
scene.go SQL performance improvements (#6378) 2025-12-08 08:08:31 +11:00
scene_filter.go Related files/folder filter for scenes/images/galleries (#6158) 2025-11-06 17:25:59 +11:00
scene_marker.go SQL performance improvements (#6378) 2025-12-08 08:08:31 +11:00
scene_marker_filter.go Scene Marker duration filter and sort (#5472) 2024-11-29 16:28:10 +11:00
scene_marker_test.go Scene Marker duration filter and sort (#5472) 2024-11-29 16:28:10 +11:00
scene_test.go Feature: Support Multiple URLs in Studios (#6223) 2025-11-10 14:34:21 +11:00
setup_test.go Feature: Support Multiple URLs in Studios (#6223) 2025-11-10 14:34:21 +11:00
sql.go Related files/folder filter for scenes/images/galleries (#6158) 2025-11-06 17:25:59 +11:00
stash_id_test.go Feature: Tag StashID support (#6255) 2025-11-13 14:24:09 +11:00
studio.go Bugfix: Fix empty Aliases Being Created for Studios (#6273) 2025-11-14 11:49:26 +11:00
studio_filter.go Feature: Support Multiple URLs in Studios (#6223) 2025-11-10 14:34:21 +11:00
studio_test.go Feature: Support Multiple URLs in Studios (#6223) 2025-11-10 14:34:21 +11:00
table.go Initialise UpdatedAt for stash ids (#5680) 2025-02-26 08:03:35 +11:00
tables.go Feature: Tag StashID support (#6255) 2025-11-13 14:24:09 +11:00
tag.go Feature: Tag StashID support (#6255) 2025-11-13 14:24:09 +11:00
tag_filter.go Add Sort Name to Tags (#5531) 2025-02-11 08:17:21 +11:00
tag_test.go Feature: Tag StashID support (#6255) 2025-11-13 14:24:09 +11:00
timestamp.go Scene play and o-counter history view and editing (#4532) 2024-02-22 11:28:18 +11:00
transaction.go Database connection pool refactor (#5274) 2024-09-20 12:56:26 +10:00
transaction_test.go Upgrade gqlgenc (#5901) 2025-06-03 08:55:51 +10:00
tx.go SQL performance improvements (#6378) 2025-12-08 08:08:31 +11:00
values.go Model refactor (#3915) 2023-09-01 10:39:29 +10:00