From 8537258ac44cefebfa7b5a4f945a4effccfd1cb7 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 30 Apr 2021 09:42:16 +0200 Subject: bin/db-update: clean up mysql logic: don't insert more than necessary, if the filter properties are available in the isnerting query anyways --- bin/db-update | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/bin/db-update b/bin/db-update index 196527e..e54e2bf 100755 --- a/bin/db-update +++ b/bin/db-update @@ -332,6 +332,10 @@ mysql_query_update_replaced_bpir() { printf ' FROM `binary_packages_in_repositories`' mysql_join_binary_packages_in_repositories_repositories printf ' AND `repositories`.`is_on_master_mirror`' + printf ' AND `repositories`.`stability`=%s' \ + "${source_stability_id}" + printf ' AND `repositories`.`architecture`=%s;\n' \ + "${arch_id}" mysql_join_repositories_architectures mysql_join_binary_packages_in_repositories_binary_packages printf ' JOIN `binary_packages` AS `f_bp`' @@ -367,16 +371,7 @@ mysql_query_update_replaced_bpir() { else # ${force_every_pkg} printf ';\n' fi - printf 'DELETE `moveable_bpir`' - printf ' FROM `moveable_bpir`' - printf ' JOIN `binary_packages_in_repositories`' - printf ' ON `binary_packages_in_repositories`.`id`=`moveable_bpir`.`id`' - mysql_join_binary_packages_in_repositories_binary_packages - mysql_join_binary_packages_in_repositories_repositories - printf ' WHERE `repositories`.`stability`!=%s' \ - "${source_stability_id}" - printf ' OR `repositories`.`architecture`!=%s;\n' \ - "${arch_id}" + printf 'UPDATE `moveable_bpir`' printf ' JOIN `binary_packages_in_repositories`' printf ' ON `binary_packages_in_repositories`.`id`=`moveable_bpir`.`id`' -- cgit v1.2.3-70-g09d2