Files
fitme3070.pt/database/migration_20260612_gallery_index.sql
T
2026-06-12 21:20:23 +01:00

7 lines
364 B
SQL

-- ─── Index gallery images by their parent gallery (O1) ──────────────────────
-- gallery.i_project_id is filtered on every gallery view (db_gallery_images) and
-- on delete, but had no index → full table scan. Add one.
ALTER TABLE `gallery`
ADD INDEX IF NOT EXISTS `idx_gallery_project` (`i_project_id`);