mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-23 19:47:07 +09:00
perf(actions): index action_run.commit_sha (#39559)
The API filter `head_sha` on `GET /repos/{owner}/{repo}/actions/runs`
selects runs by `commit_sha`, so `commit_sha` needs an index. For a
action_run table with 212k rows:
- Without the index: the query read 212k rows, and the API request took
35-52 s.
- With the index: the query read 94 rows in 0.14 s, and the API request
took 2-4 s.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
1 parent
457510fa09
commit
e0e18fc286
3 files changed
+31
-3
No files matched your search
@@ -429,6 +429,9 @@ func prepareMigrationTasks() []*migration {
|
||||
newMigration(353, "Add audit event table", v28.AddAuditEventTable),
|
||||
newMigration(354, "Add Actions job queue indexes", v28.AddActionQueueIndexes),
|
||||
newMigration(355, "Add AutoMerge merged_commit_id column", v28.AddAutoMergeMergedCommitID),
|
||||
// Gitea 28.0.0 ends at migration ID number 355 (database version 356)
|
||||
|
||||
newMigration(356, "Add index on action_run commit_sha", v28.AddActionRunCommitSHAIndex),
|
||||
}
|
||||
return preparedMigrations
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user