[open-ils-commits] r16936 - in trunk/Open-ILS/src/sql/Pg: . upgrade (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Jul 15 06:22:24 EDT 2010


Author: dbs
Date: 2010-07-15 06:22:17 -0400 (Thu, 15 Jul 2010)
New Revision: 16936

Modified:
   trunk/Open-ILS/src/sql/Pg/999.functions.global.sql
   trunk/Open-ILS/src/sql/Pg/upgrade/0337.function.asset.merge_record_assets.sql
Log:
On second thought, delete authority links pointing to stale bib records

This avoids the overhead of updating controlled fields in deleted bib records.


Modified: trunk/Open-ILS/src/sql/Pg/999.functions.global.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/999.functions.global.sql	2010-07-15 09:35:27 UTC (rev 16935)
+++ trunk/Open-ILS/src/sql/Pg/999.functions.global.sql	2010-07-15 10:22:17 UTC (rev 16936)
@@ -1103,10 +1103,10 @@
 		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;

Modified: trunk/Open-ILS/src/sql/Pg/upgrade/0337.function.asset.merge_record_assets.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0337.function.asset.merge_record_assets.sql	2010-07-15 09:35:27 UTC (rev 16935)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0337.function.asset.merge_record_assets.sql	2010-07-15 10:22:17 UTC (rev 16936)
@@ -141,10 +141,10 @@
         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;



More information about the open-ils-commits mailing list