diff --git a/docker/main/rootfs/usr/local/nginx/conf/nginx.conf b/docker/main/rootfs/usr/local/nginx/conf/nginx.conf index 46241c5ab..467bbb872 100644 --- a/docker/main/rootfs/usr/local/nginx/conf/nginx.conf +++ b/docker/main/rootfs/usr/local/nginx/conf/nginx.conf @@ -94,6 +94,7 @@ http { # vod caches vod_metadata_cache metadata_cache 512m; vod_mapping_cache mapping_cache 5m 10m; + vod_response_cache response_cache 64m; # gzip manifests gzip on; diff --git a/migrations/036_add_recordings_vod_indexes.py b/migrations/036_add_recordings_vod_indexes.py deleted file mode 100644 index 4f778a8a7..000000000 --- a/migrations/036_add_recordings_vod_indexes.py +++ /dev/null @@ -1,30 +0,0 @@ -"""Peewee migrations -- 036_add_recordings_vod_indexes.py. - -Add indexes to the recordings table optimized for the VOD overlap query: - WHERE camera = ? AND end_time > ? AND start_time < ? - ORDER BY start_time ASC - -The composite index (camera, start_time, end_time) covers the full predicate -and ordering in a single B-tree walk. The (camera, end_time) index gives the -planner an alternative access path for the end_time > ? filter. -""" - -import peewee as pw - -SQL = pw.SQL - - -def migrate(migrator, database, fake=False, **kwargs): - migrator.sql( - 'CREATE INDEX IF NOT EXISTS "idx_recordings_camera_start_end" ' - 'ON "recordings" ("camera", "start_time", "end_time")' - ) - migrator.sql( - 'CREATE INDEX IF NOT EXISTS "idx_recordings_camera_end" ' - 'ON "recordings" ("camera", "end_time")' - ) - - -def rollback(migrator, database, fake=False, **kwargs): - migrator.sql('DROP INDEX IF EXISTS "idx_recordings_camera_start_end"') - migrator.sql('DROP INDEX IF EXISTS "idx_recordings_camera_end"')