metatron-open-seo/drizzle/0027_reflective_molten_man.sql
Ben Senescu 116719a019 fix(db): add missing indexes and drop redundant ones (#319)
Postgres advisor flagged seq-scans and redundant indexes across both
backends (D1 + Postgres):

- add projects(organization_id) — org-scoped project listings seq-scanned
- add account(account_id, provider_id) — better-auth sign-in lookup
- add verification(expires_at) — expired-token cleanup range scan
- drop saved_keyword_tag_assignments_keyword_idx — covered by unique
  (saved_keyword_id, tag_id) prefix
- drop rank_snapshots_run_idx — covered by unique
  (run_id, tracking_keyword_id, device) prefix

Mirrored in both schema dialects + parity-test required-index guard.
2026-07-02 18:15:46 -04:00

2 lines
116 B
SQL

DROP INDEX `rank_snapshots_run_idx`;--> statement-breakpoint
DROP INDEX `saved_keyword_tag_assignments_keyword_idx`;