@@ -, +, @@ will do just fine for this experiment). $ ktd --shell k$ DBI_PROFILE=1 ./misc/link_bibs_to_authorities.pl -t Observe the output from the script and the DBI profiling info. [You may want to play with different DBI_PROFILE levels (such as 2, 4, 6, 8, etc.) to see what's going on under the hood DBI-wise, for reference see: https://metacpan.org/pod/DBI::Profile] --- C4/Heading/UNIMARC.pm | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) --- a/C4/Heading/UNIMARC.pm +++ a/C4/Heading/UNIMARC.pm @@ -68,19 +68,21 @@ my $bib_heading_fields; sub new { my $class = shift; - my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare( - "SELECT tagfield, authtypecode - FROM marc_subfield_structure - WHERE frameworkcode = '' AND authtypecode <> ''" - ); - $sth->execute(); - $bib_heading_fields = {}; - while ( my ( $tag, $auth_type ) = $sth->fetchrow ) { - $bib_heading_fields->{$tag} = { - auth_type => $auth_type, - subfields => 'abcdefghjklmnopqrstvxyz', - }; + unless ( defined $bib_heading_fields ) { + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare( + "SELECT tagfield, authtypecode + FROM marc_subfield_structure + WHERE frameworkcode = '' AND authtypecode <> ''" + ); + $sth->execute(); + $bib_heading_fields = {}; + while ( my ( $tag, $auth_type ) = $sth->fetchrow ) { + $bib_heading_fields->{$tag} = { + auth_type => $auth_type, + subfields => 'abcdefghjklmnopqrstvxyz', + }; + } } return bless {}, $class; --