mirror of
https://github.com/rommapp/romm.git
synced 2026-11-28 17:48:31 +01:00
Building the filter dropdowns aggregated the facet columns straight off `roms`. Those columns are cheap to compute since #3826, but they sit inline with the raw provider-metadata blobs, so the aggregation read every row of a multi-gigabyte table: seconds of pure disk reading on any database whose buffer pool is smaller than the table (the stock 128-256 MB defaults always are on a large library). `roms_facets` holds only the filter values and is kept in sync by AFTER INSERT/UPDATE triggers on `roms`, so every write path stays consistent without an application hook. Deletes ride the ON DELETE CASCADE foreign key. Fixes #3882 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>