[Git][qa/jenkins.debian.net][master] reproducible Alpine: speed up sql queries, thanks to Myon! <3

Holger Levsen (@holger) gitlab at salsa.debian.org
Tue Jul 11 14:22:43 BST 2023



Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net


Commits:
633eabf5 by Holger Levsen at 2023-07-11T15:21:43+02:00
reproducible Alpine: speed up sql queries, thanks to Myon! <3

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -


2 changed files:

- bin/reproducible_alpine_scheduler.sh
- bin/reproducible_html_alpine.sh


Changes:

=====================================
bin/reproducible_alpine_scheduler.sh
=====================================
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# Copyright 2015-2022 Holger Levsen <holger at layer-acht.org>
+# Copyright 2015-2023 Holger Levsen <holger at layer-acht.org>
 #                2019 kpcyrd <git at rxv.cc>
 # released under the GPLv2
 
@@ -165,7 +165,7 @@ update_alpine_repositories() {
 		AND s.architecture='x86_64'
 		AND (r.status LIKE 'DEPWAIT%' OR r.status LIKE '404%')
 		AND r.build_date < '$MINDATE'
-		AND s.id NOT IN (SELECT package_id FROM schedule WHERE build_type = 'ci_build')
+		AND NOT exists (SELECT FROM schedule WHERE package_id = s.id AND build_type = 'ci_build')
 		LIMIT $MAX;"
 	local DEPWAIT404=$(query_db "$QUERY")
 	if [ -n "$DEPWAIT404" ] ; then
@@ -196,7 +196,7 @@ update_alpine_repositories() {
 			AND s.architecture='x86_64'
 			AND r.status != 'blacklisted'
 			AND r.build_date < '$MINDATE'
-			AND s.id NOT IN (SELECT schedule.package_id FROM schedule WHERE build_type = 'ci_build')
+			AND NOT exists (SELECT FROM schedule WHERE package_id = s.id AND build_type = 'ci_build')
 			GROUP BY s.id, s.name
 			ORDER BY max_date
 			LIMIT $MAX;"


=====================================
bin/reproducible_html_alpine.sh
=====================================
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# Copyright 2014-2019 Holger Levsen <holger at layer-acht.org>
+# Copyright 2014-2023 Holger Levsen <holger at layer-acht.org>
 #                2015 anthraxx <levente at leventepolyak.net>
 #                2019 kpcyrd <git at rxv.cc>
 # released under the GPLv2
@@ -64,7 +64,7 @@ repostats(){
 		NR_404=$(query_db "SELECT count(*) FROM sources AS s JOIN results AS r ON s.id=r.package_id WHERE s.distribution=$DISTROID AND s.architecture='x86_64' AND s.suite='$SUITE' AND r.status LIKE '404_%';")
 		NR_BLACKLISTED=$(query_db "SELECT count(*) FROM sources AS s JOIN results AS r ON s.id=r.package_id WHERE s.distribution=$DISTROID AND s.architecture='x86_64' AND s.suite='$SUITE' AND r.status='blacklisted';")
 		NR_UNKNOWN=$(query_db "SELECT count(*) FROM sources AS s JOIN results AS r ON s.id=r.package_id WHERE s.distribution=$DISTROID AND  s.architecture='x86_64' AND s.suite='$SUITE' AND r.status LIKE 'UNKNOWN_%';")
-		NR_UNTESTED=$(query_db "SELECT count(s.name) FROM sources AS s WHERE s.architecture='x86_64' AND s.distribution=$DISTROID AND s.suite='$SUITE' AND s.id NOT IN (SELECT package_id FROM results)")
+		NR_UNTESTED=$(query_db "SELECT count(s.name) FROM sources AS s WHERE s.architecture='x86_64' AND s.distribution=$DISTROID AND s.suite='$SUITE' AND NOT exists (SELECT FROM results WHERE package_id = s.id )")
 		if [ $NR_UNTESTED -ne 0 ] ; then
 			let NR_UNKNOWN=$NR_UNKNOWN+$NR_UNTESTED
 		fi
@@ -264,7 +264,7 @@ state_pages(){
 			UNTESTED=$(query_db "SELECT count(s.name) FROM sources AS s
 					WHERE s.distribution=$DISTROID
 					AND s.architecture='x86_64'
-					AND s.id NOT IN (SELECT package_id FROM results)")
+					AND NOT exists (SELECT FROM results WHERE package_id = s.id )")
 			if [ $UNTESTED -ne 0 ] ; then
 				let TESTED=$TESTED+$UNTESTED
 			fi
@@ -290,7 +290,7 @@ state_pages(){
 					WHERE s.distribution=$DISTROID
 					AND s.architecture='x86_64'
 					AND s.suite='$SUITE'
-					AND s.id NOT IN (SELECT package_id FROM results)
+					AND NOT exists (SELECT FROM results WHERE package_id = s.id )
 					ORDER BY s.name")
 				for SRCPACKAGE in ${STATE_PKGS} ; do
 					include_pkg_html_in_page
@@ -323,7 +323,7 @@ repository_state_pages(){
 						WHERE s.distribution=$DISTROID
 						AND s.architecture='x86_64'
 						AND s.suite='$SUITE'
-						AND s.id NOT IN (SELECT package_id FROM results)")
+						AND NOT exists (SELECT FROM results WHERE package_id = s.id )")
 				if [ $UNTESTED -ne 0 ] ; then
 					let TESTED=$TESTED+$UNTESTED
 				fi
@@ -347,7 +347,7 @@ repository_state_pages(){
 					WHERE s.distribution=$DISTROID
 					AND s.architecture='x86_64'
 					AND s.suite='$SUITE'
-					AND s.id NOT IN (SELECT package_id FROM results)
+					AND NOT exists (SELECT FROM results WHERE package_id = s.id )
 					ORDER BY s.name")
 				for SRCPACKAGE in ${STATE_PKGS} ; do
 					include_pkg_html_in_page



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/633eabf5316b11b5104e2536655b540cd0dada29

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/633eabf5316b11b5104e2536655b540cd0dada29
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20230711/c97d18b7/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list