[open-ils-commits] r10298 - trunk/Open-ILS/src/extras/import
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Aug 7 10:23:23 EDT 2008
Author: dbs
Date: 2008-08-07 10:23:16 -0400 (Thu, 07 Aug 2008)
New Revision: 10298
Modified:
trunk/Open-ILS/src/extras/import/parallel_pg_loader.pl
Log:
Per Brandon Uhlmann's suggestion, speed up bibloading by automatically disabling/reenabling materialized record trigger
Modified: trunk/Open-ILS/src/extras/import/parallel_pg_loader.pl
===================================================================
--- trunk/Open-ILS/src/extras/import/parallel_pg_loader.pl 2008-08-07 13:49:48 UTC (rev 10297)
+++ trunk/Open-ILS/src/extras/import/parallel_pg_loader.pl 2008-08-07 14:23:16 UTC (rev 10298)
@@ -1,5 +1,6 @@
#!/usr/bin/perl
use strict;
+use warnings;
use lib '/openils/lib/perl5/';
@@ -42,7 +43,6 @@
$main_out->print("BEGIN;\n\n");
my %out_files;
-my %out_headers;
for my $h (@order) {
$out_files{$h} = FileHandle->new(">$output.$h.sql");
binmode($out_files{$h},'utf8');
@@ -82,6 +82,10 @@
my $fields = join(',', @{ $fieldcache{$hint}{fields} });
$main_out->print( "DELETE FROM $fieldcache{$hint}{table};\n" ) if (grep {$_ eq $hint } @wipe);
+ # Speed up loading of bib records
+ if ($hint eq 'mfr') {
+ $main_out->print("\nSELECT reporter.disable_materialized_simple_record_trigger();\n");
+ }
$main_out->print( "COPY $fieldcache{$hint}{table} ($fields) FROM '$pwd/$output.$hint.sql';\n" );
}
@@ -114,5 +118,8 @@
$count++;
}
+if (grep /^mfr$/, %out_files) {
+ $main_out->print("SELECT reporter.enable_materialized_simple_record_trigger();\n");
+}
$main_out->print("-- COMMIT;\n\n");
$main_out->close;
More information about the open-ils-commits
mailing list