diff options
author | Christopher Baines <mail@cbaines.net> | 2024-09-07 21:03:57 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2024-09-07 21:03:57 +0100 |
commit | b7ce9fe008de1af20a82aba2108c2897884d90bc (patch) | |
tree | 0cabda4a16500037fe98c58c00177d0421ca4f53 /guix-data-service/model | |
parent | 4ecd20b973dd8c38ba9dc139572e2f4b5c9f7e0b (diff) | |
download | data-service-b7ce9fe008de1af20a82aba2108c2897884d90bc.tar data-service-b7ce9fe008de1af20a82aba2108c2897884d90bc.tar.gz |
Speed up select-builds-with-context-by-derivation-output
Diffstat (limited to 'guix-data-service/model')
-rw-r--r-- | guix-data-service/model/build.scm | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/guix-data-service/model/build.scm b/guix-data-service/model/build.scm index 86eac9d..3822459 100644 --- a/guix-data-service/model/build.scm +++ b/guix-data-service/model/build.scm @@ -283,13 +283,14 @@ FROM builds INNER JOIN build_servers ON build_servers.id = builds.build_server_id INNER JOIN latest_build_status ON latest_build_status.build_id = builds.id -INNER JOIN derivation_output_details_sets - ON builds.derivation_output_details_set_id = - derivation_output_details_sets.id -INNER JOIN derivation_output_details - ON ARRAY[derivation_output_details.id] <@ - derivation_output_details_sets.derivation_output_details_ids -WHERE derivation_output_details.path = $1 +WHERE builds.derivation_output_details_set_id = ( + SELECT derivation_output_details_sets.id + FROM derivation_output_details_sets + INNER JOIN derivation_output_details + ON ARRAY[derivation_output_details.id] <@ + derivation_output_details_sets.derivation_output_details_ids + WHERE derivation_output_details.path = $1 +) ORDER BY latest_build_status.timestamp DESC") (exec-query-with-null-handling conn query (list output))) |