From: dbs Date: Thu, 15 Jul 2010 10:22:17 +0000 (+0000) Subject: On second thought, delete authority links pointing to stale bib records X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1fd9a9ad71cb0ee6abdea25f64d88f725855c37c;p=evergreen%2Fbjwebb.git On second thought, delete authority links pointing to stale bib records This avoids the overhead of updating controlled fields in deleted bib records. git-svn-id: svn://svn.open-ils.org/ILS/trunk@16936 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/sql/Pg/999.functions.global.sql b/Open-ILS/src/sql/Pg/999.functions.global.sql index 6124ad0e8..fcf0d5f1d 100644 --- a/Open-ILS/src/sql/Pg/999.functions.global.sql +++ b/Open-ILS/src/sql/Pg/999.functions.global.sql @@ -1103,10 +1103,10 @@ BEGIN moved_objects := moved_objects + 1; END LOOP; - -- Find and move authority->bib links to the target record + -- Delete authority->bib links to the source record to avoid + -- the overhead of updating controlled fields in deleted records FOR auth_link IN SELECT * FROM authority.bib_linking WHERE bib = source_record LOOP - UPDATE authority.bib_linking - SET bib = target_record + DELETE FROM authority.bib_linking WHERE id = auth_link.id; moved_objects := moved_objects + 1; diff --git a/Open-ILS/src/sql/Pg/upgrade/0337.function.asset.merge_record_assets.sql b/Open-ILS/src/sql/Pg/upgrade/0337.function.asset.merge_record_assets.sql index ef73095a3..af36d9f72 100644 --- a/Open-ILS/src/sql/Pg/upgrade/0337.function.asset.merge_record_assets.sql +++ b/Open-ILS/src/sql/Pg/upgrade/0337.function.asset.merge_record_assets.sql @@ -141,10 +141,10 @@ BEGIN moved_objects := moved_objects + 1; END LOOP; - -- Find and move authority->bib links to the target record + -- Delete authority->bib links to the source record to avoid + -- the overhead of updating controlled fields in deleted records FOR auth_link IN SELECT * FROM authority.bib_linking WHERE bib = source_record LOOP - UPDATE authority.bib_linking - SET bib = target_record + DELETE FROM authority.bib_linking WHERE id = auth_link.id; moved_objects := moved_objects + 1;