Commit 1bf17d3
committed
db: add partial indexes on players for active=true query path
Drop redundant plain-ASC rating indexes (players_standard/rapid/blitz_idx)
since Postgres can scan the existing DESC NULLS LAST indexes backwards for
ASC queries.
Add WHERE active=true partial indexes for all API-facing queries:
- players_standard_active_idx
- players_rapid_active_idx
- players_blitz_active_idx
- players_federation_id_active_idx
The planner will prefer these smaller, denser indexes over the full
players_*_desc_idx variants whenever the query includes active=true,
which is the case for all public API endpoints.1 parent 7e64055 commit 1bf17d3
1 file changed
Lines changed: 16 additions & 0 deletions
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments