Commit f7ac0f4
committed
perf(webapp,database): index the newest-task-version lookup
Schedule validation seeks (projectId, slug) and then sorts every matching
row by createdAt to return one. A project gains a row per task per deploy,
so the sort grows with project age. Index the sort key so Postgres scans
backward and stops at the first row, and select only the field the check
reads.1 parent 771937a commit f7ac0f4
4 files changed
Lines changed: 11 additions & 0 deletions
File tree
- .server-changes
- apps/webapp/app/v3/services
- internal-packages/database/prisma
- migrations/20260806100000_add_background_worker_task_project_id_slug_created_at_index
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
752 | 752 | | |
753 | 753 | | |
754 | 754 | | |
| 755 | + | |
755 | 756 | | |
756 | 757 | | |
757 | 758 | | |
| |||
0 commit comments