William Reed
4a48233cff
perf: fix database query performance bottlenecks ( #1982 )
...
* perf: fix database query performance bottlenecks
- Add composite index on workspace_repos(workspace_id, repo_id) to optimize lookup queries that were taking up to 5 seconds
- Add composite index on merges(merge_type, pr_status) to optimize status filtering queries that were taking 2+ seconds
- Fix N+1 query pattern in workspace_repos.create_many by wrapping inserts in a transaction
- Fix N+1 query pattern in get_task_attempt_branch_status by batch fetching all merges upfront instead of querying per repo
These changes address significant performance bottlenecks identified in production logs where simple lookup queries were experiencing multi-second latencies.
* cargo fmt
* run sqlx prepare
---------
Co-authored-by: Solomon <abcpro11051@disroot.org >
2026-01-14 11:04:22 +00:00
..
2025-12-18 14:45:10 +00:00
2025-08-08 13:53:27 +01:00
2025-12-18 14:45:10 +00:00
2026-01-08 22:14:38 +00:00
2026-01-11 08:03:19 +00:00
2026-01-11 08:03:19 +00:00
2026-01-08 22:14:38 +00:00
2025-08-08 13:53:27 +01:00
2026-01-06 11:00:48 +00:00
2026-01-11 08:03:19 +00:00
2025-12-18 14:45:10 +00:00
2025-12-18 14:45:10 +00:00
2025-12-18 14:45:10 +00:00
2025-12-18 14:45:10 +00:00
2025-12-16 10:55:27 +00:00
2026-01-08 22:14:38 +00:00
2025-12-02 14:52:27 +00:00
2026-01-08 22:14:38 +00:00
2025-12-18 14:45:10 +00:00
2026-01-11 08:03:19 +00:00
2025-12-16 10:55:27 +00:00
2026-01-11 08:03:19 +00:00
2025-08-20 11:54:32 +01:00
2025-12-04 15:57:32 +00:00
2025-12-18 14:45:10 +00:00
2026-01-11 08:03:19 +00:00
2026-01-11 08:03:19 +00:00
2025-12-18 14:45:10 +00:00
2025-12-18 14:45:10 +00:00
2025-12-02 14:52:27 +00:00
2025-11-14 15:37:56 +00:00
2025-12-16 10:55:27 +00:00
2025-12-18 14:45:10 +00:00
2026-01-11 08:03:19 +00:00
2026-01-11 08:03:19 +00:00
2025-12-18 14:45:10 +00:00
2025-12-18 14:45:10 +00:00
2025-12-03 13:11:00 +00:00
2025-12-18 14:45:10 +00:00
2026-01-12 09:14:48 +00:00
2025-12-18 14:45:10 +00:00
2025-12-16 10:55:27 +00:00
2026-01-08 22:14:38 +00:00
2026-01-08 22:14:38 +00:00
2025-12-18 14:45:10 +00:00
2026-01-13 18:00:57 +00:00
2025-10-23 17:46:00 +01:00
2026-01-12 12:09:11 +00:00
2026-01-11 08:03:19 +00:00
2025-08-20 11:54:32 +01:00
2025-12-16 10:55:27 +00:00
2025-12-18 14:45:10 +00:00
2026-01-08 22:14:38 +00:00
2025-12-18 14:45:10 +00:00
2026-01-11 08:03:19 +00:00
2026-01-08 22:14:38 +00:00
2026-01-08 22:14:38 +00:00
2025-12-18 14:45:10 +00:00
2025-10-23 17:46:00 +01:00
2026-01-08 22:14:38 +00:00
2025-12-16 10:55:27 +00:00
2025-12-18 14:45:10 +00:00
2025-12-18 14:45:10 +00:00
2025-08-20 11:54:32 +01:00
2025-12-18 14:45:10 +00:00
2026-01-08 22:14:38 +00:00
2025-12-18 14:45:10 +00:00
2025-12-18 14:45:10 +00:00
2026-01-08 22:14:38 +00:00
2025-12-18 14:45:10 +00:00
2025-11-17 17:45:15 +00:00
2025-12-18 14:45:10 +00:00
2025-09-09 19:28:06 +01:00
2025-12-18 14:45:10 +00:00
2025-10-23 17:46:00 +01:00
2025-12-18 14:45:10 +00:00
2026-01-11 08:03:19 +00:00
2026-01-08 22:14:38 +00:00
2026-01-11 08:03:19 +00:00
2026-01-11 08:03:19 +00:00
2026-01-08 22:14:38 +00:00
2025-12-18 14:45:10 +00:00
2026-01-08 22:14:38 +00:00
2026-01-11 08:03:19 +00:00
2025-08-20 11:54:32 +01:00
2025-08-20 11:54:32 +01:00
2025-12-18 14:45:10 +00:00
2025-10-23 17:46:00 +01:00
2025-12-18 14:45:10 +00:00
2026-01-11 08:03:19 +00:00
2026-01-08 22:14:38 +00:00
2025-12-02 14:52:27 +00:00
2025-12-18 14:45:10 +00:00
2025-08-08 13:53:27 +01:00
2026-01-08 22:14:38 +00:00
2025-12-18 14:45:10 +00:00
2025-12-18 14:45:10 +00:00
2025-11-17 17:45:15 +00:00
2025-12-02 14:52:27 +00:00
2025-12-18 14:45:10 +00:00
2026-01-08 22:14:38 +00:00
2025-12-16 10:55:27 +00:00
2025-11-14 15:37:56 +00:00
2025-12-18 14:45:10 +00:00
2026-01-11 08:03:19 +00:00
2026-01-11 08:03:19 +00:00
2025-12-18 14:45:10 +00:00
2026-01-11 08:03:19 +00:00
2026-01-08 22:14:38 +00:00
2025-12-18 14:45:10 +00:00
2025-12-18 14:45:10 +00:00
2025-08-20 11:54:32 +01:00
2025-12-18 14:45:10 +00:00
2025-12-18 14:45:10 +00:00
2025-12-18 14:45:10 +00:00
2026-01-08 22:14:38 +00:00
2025-12-02 14:52:27 +00:00
2026-01-08 22:14:38 +00:00
2025-12-18 14:45:10 +00:00
2026-01-08 22:14:38 +00:00
2025-12-18 14:45:10 +00:00
2026-01-11 08:03:19 +00:00
2025-10-23 17:46:00 +01:00
2025-12-18 14:45:10 +00:00
2025-12-02 14:52:27 +00:00
2025-09-19 18:25:12 +01:00
2025-12-04 15:57:32 +00:00
2026-01-14 11:04:22 +00:00
2025-08-20 11:54:32 +01:00
2025-12-16 10:55:27 +00:00