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

reproducible Alpine: speed up sql queries, thanks to Myon! <3

parent 4153d0d0
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# Copyright 2015-2022 Holger Levsen <holger@layer-acht.org>
# Copyright 2015-2023 Holger Levsen <holger@layer-acht.org>
# 2019 kpcyrd <git@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/bash
# Copyright 2014-2019 Holger Levsen <holger@layer-acht.org>
# Copyright 2014-2023 Holger Levsen <holger@layer-acht.org>
# 2015 anthraxx <levente@leventepolyak.net>
# 2019 kpcyrd <git@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
......
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