Skip to content
Snippets Groups Projects
Commit 0950ab36 authored by Holger Levsen's avatar Holger Levsen
Browse files

reproducible Arch Linux: speed up several sql queries, thanks Myon! <3

parent 5e79c430
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# Copyright 2015-2019 Holger Levsen <holger@layer-acht.org>
# Copyright 2015-2023 Holger Levsen <holger@layer-acht.org>
# released under the GPLv2
DEBUG=false
......@@ -167,7 +167,7 @@ update_archlinux_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
......@@ -198,7 +198,7 @@ update_archlinux_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 where package_id = s.id AND build_type='ci_build')
GROUP BY s.id, s.name
ORDER BY max_date
LIMIT $MAX;"
......
#!/bin/bash
# Copyright 2014-2019 Holger Levsen <holger@layer-acht.org>
# Copyright 2014-2023 Holger Levsen <holger@layer-acht.org>
# 2015 anthraxx <levente@leventepolyak.net>
# released under the GPLv2
......@@ -63,7 +63,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
......@@ -263,7 +263,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
......@@ -289,7 +289,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
......@@ -322,7 +322,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
......@@ -346,7 +346,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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment