Avoid updating deleted call numbers for 2.0 -> 2.1 upgrade user/dbs/avoid_2.1_upgrade_pain_2_1
authorDan Scott <dscott@laurentian.ca>
Tue, 22 Nov 2011 17:00:06 +0000 (12:00 -0500)
committerDan Scott <dscott@laurentian.ca>
Tue, 22 Nov 2011 17:00:06 +0000 (12:00 -0500)
25% of the call numbers on our production system are deleted, so
filtering out the deleted call numbers from the update in the 2.0 ->
2.1 upgrade saves a significant amount of time.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/sql/Pg/2.0-2.1-upgrade-db.sql

index 4c9686f..facd386 100644 (file)
@@ -5669,7 +5669,7 @@ $func$ LANGUAGE plpgsql;
 -- 0505
 UPDATE metabib.facet_entry SET value = evergreen.force_unicode_normal_form(value,'NFC');
 
-UPDATE asset.call_number SET id = id;
+UPDATE asset.call_number SET id = id WHERE deleted IS FALSE or deleted = FALSE;
 
 -- Update reporter.materialized_simple_record with normalized ISBN values
 -- This might not get all of them, but most ISBNs will have more than one hyphen