new version, doing tag by tag. Should be slower, but requires a lot less memory
authortipaul <tipaul>
Wed, 1 Jun 2005 18:55:08 +0000 (18:55 +0000)
committertipaul <tipaul>
Wed, 1 Jun 2005 18:55:08 +0000 (18:55 +0000)
misc/build_marc_Tword.pl

index 5e2fbba..ee11831 100755 (executable)
@@ -54,7 +54,7 @@ my $starttime = gettimeofday;
 $dbh->do("delete from marc_Tword");
 
 # parse every line
-my $query="SELECT biblio.biblionumber,tag,subfieldcode,subfieldvalue,biblio.title FROM marc_subfield_table left join marc_biblio on marc_biblio.bibid=marc_subfield_table.bibid left join biblio on marc_biblio.biblionumber=biblio.biblionumber and tag=?";
+my $query="SELECT biblio.biblionumber,tag,subfieldcode,subfieldvalue,biblio.title FROM marc_subfield_table left join marc_biblio on marc_biblio.bibid=marc_subfield_table.bibid left join biblio on marc_biblio.biblionumber=biblio.biblionumber where tag=?";
 my $sth=$dbh->prepare($query);
 
 for (my $looptag=0;$looptag<=999;$looptag++) {
@@ -94,7 +94,9 @@ for (my $looptag=0;$looptag<=999;$looptag++) {
        
        # 2nd version : faster (about 100 times !), bug maybe too much RAM consumming...
        my %largehash;
-       print "READING\n";
+#      print "READING\n";
+       $timeneeded = gettimeofday - $starttime unless ($i % 30000);
+       print "READING $timeneeded s\n";
        while (my ($biblionumber, $tag, $subfieldcode, $subfieldvalue, $title) = $sth->fetchrow) {
                next unless $subfieldvalue;
                next if $ignore_list{$tag.$subfieldcode};