mirror of
https://github.com/rommapp/romm.git
synced 2026-11-28 17:48:31 +01:00
The Server Stats page ran two full scans of the multi-gigabyte `roms` table on every visit: the metadata-coverage breakdown counted eleven provider-id columns per platform, and the region breakdown pulled every row's regions into Python. Both were returned in the same request as the cheap summary counts, so the whole page stayed blank until they finished. Mirror the provider match ids into the narrow `roms_facets` table (migration 0102, kept in sync by the same triggers as the existing facet columns) and read both breakdowns from it, so neither query touches `roms`. Split the v2 Server Stats view into a summary-first request and a separate breakdown request so the six top cards render immediately. Fixes #3901 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>