Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): index active thread sweep expressions #21777

Openjuliusmarmingewants to merge 3 commits intoserver-persistence-03/startup-scheduling fromserver-persistence-03/sweep-indexesopened View on GitHub

Showing 7 changed files with 10 additions and 5 deletions (loading 4).

x
0 of 7 viewed, 7 left
3 additions and 3 deletionsapps/server/src/orchestration-v2/ProjectionStore.tsModified
View file
@@ -5454,7 +5454,7 @@
projectId === undefined ? sql`` : sql` AND t.project_id = ${projectId}`
location === "active"
- ? sql` AND json_extract(t.payload_json, '$.archivedAt') IS NULL`
+ ? sql` AND t.archived_at IS NULL`
: location === "archive"
? sql` AND json_extract(t.payload_json, '$.archivedAt') IS NOT NULL`
: sql``
@@ -5635,7 +5635,7 @@
LIMIT 1
WHERE t.deleted_at IS NULL${threadId === undefined ? sql`` : sql` AND t.thread_id = ${threadId}`}
- AND json_extract(t.payload_json, '$.archivedAt') IS NULL
+ AND t.archived_at IS NULL
AND json_extract(t.payload_json, '$.settledOverride') IS NULL
AND json_extract(t.payload_json, '$.pinnedAt') IS NULL
AND json_extract(t.payload_json, '$.autoSettleDisabledAt') IS NULL
@@ -5721,7 +5721,7 @@
SELECT payload_json
FROM orchestration_v2_projection_threads
WHERE deleted_at IS NULL${threadId === undefined ? sql`` : sql` AND thread_id = ${threadId}`}
- AND json_extract(payload_json, '$.archivedAt') IS NULL
+ AND archived_at IS NULL
AND json_array_length(payload_json, '$.pullRequests') > 0
ORDER BY updated_at ASC, thread_id ASC