Bug 16855 - Poor performance due to high overhead of SQL call in export.pl
authorNick Clemens <nick@bywatersolutions.com>
Tue, 5 Jul 2016 18:49:35 +0000 (14:49 -0400)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 8 Jul 2016 12:54:27 +0000 (12:54 +0000)
This patch eliminates all columns retrieved in the biblioitems query
except for biblionumber.

To test:
1 - Go to tools->Export data
2 - Export using various filters and note you get expected records
3 - Apply patch
4 - Ensure exported results match results before patch

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
tools/export.pl

index 4794d05..373ebfa 100755 (executable)
@@ -148,7 +148,7 @@ if ( $op eq "export" ) {
                     ),
 
                 };
-                my $biblioitems = Koha::Biblioitems->search( $conditions, { join => 'items' } );
+                my $biblioitems = Koha::Biblioitems->search( $conditions, { join => 'items', columns => 'biblionumber' } );
                 while ( my $biblioitem = $biblioitems->next ) {
                     push @record_ids, $biblioitem->biblionumber;
                 }