Speed up 0663 upgrade script collab/dyrcona/faster_0663_upgrade
authorThomas Berezansky <tsbere@mvlc.org>
Mon, 9 Jan 2012 18:58:07 +0000 (13:58 -0500)
committerJason Stephenson <jstephenson@mvlc.org>
Tue, 24 Jan 2012 14:47:34 +0000 (09:47 -0500)
commitb148e4d664349017d7f54ea1c3449729474c6db4
tree7bce818beff7cc53673ef5f6172dc51d4bcc7325
parent56fa348c351da2e4d1a9af9903c91a4b7ab8f33b
Speed up 0663 upgrade script

Move update to the end

This ensures most of the rest goes without error first

Disable triggers on the table before doing update

This speeds the update up significantly as we don't need to re-calc the
additional column's new data.

Allow new column to be null (at first) with no default

This allows the column to be added *without* re-writing every row. We still
re-write every row with the update, but at least we aren't doing that
*twice* this way.

And add the not null/default to new column and re-enable triggers as our
last action.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/src/sql/Pg/upgrade/0663.schema.archive_circ_stat_cats.sql