cbaines pushed a commit to branch master in repository data-service. commit 5e88a98c47e4341211b2e6ab0355a0eaf1aba618 Author: Christopher Baines <m...@cbaines.net> AuthorDate: Thu Jun 20 15:33:29 2024 +0100
Speed up select-build-outputs --- guix-data-service/model/build.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/guix-data-service/model/build.scm b/guix-data-service/model/build.scm index 1240453..86eac9d 100644 --- a/guix-data-service/model/build.scm +++ b/guix-data-service/model/build.scm @@ -136,12 +136,14 @@ WHERE builds.id = $1" (exec-query conn " +WITH derivation_output_details_ids (id) AS ( + SELECT unnest(derivation_output_details_ids) AS id + FROM derivation_output_details_sets + WHERE derivation_output_details_sets.id = $1 +) SELECT derivation_output_details.path FROM derivation_output_details -INNER JOIN derivation_output_details_sets - ON ARRAY[derivation_output_details.id] && - derivation_output_details_sets.derivation_output_details_ids -WHERE derivation_output_details_sets.id = $1" +WHERE derivation_output_details.id IN (SELECT id FROM derivation_output_details_ids)" (list output-details-set-id)) (exec-query conn