[open-ils-commits] r10299 - trunk/Open-ILS/src/extras/import
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Aug 7 10:30:49 EDT 2008
Author: dbs
Date: 2008-08-07 10:30:43 -0400 (Thu, 07 Aug 2008)
New Revision: 10299
Modified:
trunk/Open-ILS/src/extras/import/pg_loader.pl
Log:
Per Brandon Uhlmann's suggestion, speed up loading of bibs by automatically disabling/reenabling materialized record trigger
Modified: trunk/Open-ILS/src/extras/import/pg_loader.pl
===================================================================
--- trunk/Open-ILS/src/extras/import/pg_loader.pl 2008-08-07 14:23:16 UTC (rev 10298)
+++ trunk/Open-ILS/src/extras/import/pg_loader.pl 2008-08-07 14:30:43 UTC (rev 10299)
@@ -89,6 +89,10 @@
my $fields = join(',', @{ $fieldcache{$h}{fields} });
$output->print( "DELETE FROM $fieldcache{$h}{table};\n" ) if (grep {$_ eq $h } @wipe);
+ # Speed up loading of bib records
+ if ($h eq 'mfr') {
+ $output->print("\nSELECT reporter.disable_materialized_simple_record_trigger();\n");
+ }
$output->print( "COPY $fieldcache{$h}{table} ($fields) FROM STDIN;\n" );
for my $line (@{ $lineset{$h} }) {
@@ -115,6 +119,10 @@
$output->print('\.'."\n\n");
+ if ($h eq 'mfr') {
+ $output->print("SELECT reporter.enable_materialized_simple_record_trigger();\n");
+ }
+
$output->print("SELECT setval('$fieldcache{$h}{sequence}'::TEXT, (SELECT MAX($fieldcache{$h}{pkey}) FROM $fieldcache{$h}{table}), TRUE);\n\n")
if (!grep { $_ eq $h} @auto);
}
More information about the open-ils-commits
mailing list