Skip to main content

max / makenotwork

407 B · 10 lines History Blame Raw
1 -- Composite index for the `list user's media filtered by scan_status` query
2 -- path. Without it, listing a creator's clean media files scans the full
3 -- (user_id) partition and filters in memory, which becomes a hotspot on
4 -- accounts with thousands of media rows.
5 --
6 -- Run #2 audit, medium-priority.
7
8 CREATE INDEX IF NOT EXISTS idx_media_files_user_scan_status
9 ON media_files (user_id, scan_status);
10