Skip to content

Commit

Permalink
rsc: Optimize blob eviction query (#1635)
Browse files Browse the repository at this point in the history
  • Loading branch information
V-FEXrt authored Aug 22, 2024
1 parent cb8736c commit 1a02ebe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rust/rsc/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -685,12 +685,12 @@ pub async fn delete_unreferenced_blobs<T: ConnectionTrait>(
r#"
WITH
eligible_blob_ids as (
SELECT id FROM blob
SELECT DISTINCT id FROM blob
WHERE updated_at <= $1
EXCEPT (
SELECT blob_id FROM output_file
UNION SELECT stdout_blob_id FROM job
UNION SELECT stderr_blob_id FROM job
UNION ALL SELECT stdout_blob_id FROM job
UNION ALL SELECT stderr_blob_id FROM job
)
LIMIT $2
)
Expand Down

0 comments on commit 1a02ebe

Please sign in to comment.