| 1 | -- Indexes for the dashboard's filter/aggregation queries. Apply: |
| 2 | -- wrangler d1 execute reasonix-crash --remote --file=migrate-dashboard-indexes.sql |
| 3 | -- groups has no index but crashGroups filters/sorts by these columns every load. |
| 4 | -- The date-partitioned tables are deliberately left alone — see |
| 5 | -- migrate-window-index-fix.sql for why a GROUP BY index loses to their PK. |
| 6 | CREATE INDEX IF NOT EXISTS groups_status ON groups (status); |
| 7 | CREATE INDEX IF NOT EXISTS groups_source ON groups (source); |
| 8 | CREATE INDEX IF NOT EXISTS groups_last_version ON groups (last_version); |
| 9 | CREATE INDEX IF NOT EXISTS groups_last_os ON groups (last_os); |
| 10 | CREATE INDEX IF NOT EXISTS groups_first_version ON groups (first_version); |
| 11 |