/[webpac]/trunk/index_DBI_cache.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/index_DBI_cache.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 60 by dpavlin, Fri Jul 4 18:23:00 2003 UTC revision 88 by dpavlin, Sat Jul 12 16:02:15 2003 UTC
# Line 17  my %sth_cache; # cache prepared statemen Line 17  my %sth_cache; # cache prepared statemen
17  my $c_table;  my $c_table;
18  my $c_count;  my $c_count;
19    
20    # bench time
21    my $t = time();
22    
23  sub new {  sub new {
24          my $class = shift;          my $class = shift;
25          my $self = {};          my $self = {};
# Line 99  sub insert { Line 102  sub insert {
102          $index_data = substr($index_data,0,255);          $index_data = substr($index_data,0,255);
103          my $uc = uc($index_data);          my $uc = uc($index_data);
104          if (! $c_table->{$field}->{$ident}->{$uc}) {          if (! $c_table->{$field}->{$ident}->{$uc}) {
105                  $sth_cache{$field."insert"}->execute($index_data,$ident,0) || die "cache: $field insert; ".$self->{dbh}->errstr();                  $sth_cache{$field."insert"}->execute($index_data,$ident,0) || warn "cache: $field insert ($index_data,$ident); ".$self->{dbh}->errstr();
106  #print stderr "in index: $index_data\n";  #print stderr "in index: $index_data\n";
107                  $c_table->{$field}->{$ident}->{$uc} = $index_data;                  $c_table->{$field}->{$ident}->{$uc} = $index_data;
108                  $c_count->{$field}->{$ident}->{$uc} = 1;                  $c_count->{$field}->{$ident}->{$uc} = 1;
# Line 191  sub close { Line 194  sub close {
194    
195                  foreach my $table (keys %Table) {                  foreach my $table (keys %Table) {
196  # FIX  # FIX
197    print STDERR "last operation took ",time()-$t," seconds...\n";
198    $t=time();
199  print STDERR "creating ord for $table...\n";  print STDERR "creating ord for $table...\n";
200                          create_ord($table);                          create_ord($table);
201                          undef $sth_cache{$table."select"};                          undef $sth_cache{$table."select"};

Legend:
Removed from v.60  
changed lines
  Added in v.88

  ViewVC Help
Powered by ViewVC 1.1.26