Commit 9964c74
feat(perf): speedup available jobs query for user/org runner (#13666)
- The current query is not incorrect or has a inherent performance
problem, but MariaDB choses a very wrong query plan for the
`action_run_job`, `IDX_action_run_job_repo_id` over
`IDX_action_run_job_status`. On surface level the former index looks
like a good choice, for a organisation like Forgejo with many already
executed jobs, it doesn't become a very effective index. The status
index filters very well, because there aren't that many that have as
status "waiting".
- Relevant: forgejo/forgejo!13658
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/13666
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>1 parent 40c9bd6 commit 9964c74
2 files changed
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
317 | | - | |
| 316 | + | |
| 317 | + | |
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| 72 | + | |
71 | 73 | | |
72 | | - | |
| 74 | + | |
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
| 78 | + | |
76 | 79 | | |
77 | | - | |
| 80 | + | |
78 | 81 | | |
79 | 82 | | |
80 | 83 | | |
| |||
0 commit comments