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 = {}; |
99 |
$Table{$field}++; |
$Table{$field}++; |
100 |
|
|
101 |
#$sth_cache{$field."select"}->execute($index_data) || die "cache: $field select; ".$self->{dbh}->errstr(); |
#$sth_cache{$field."select"}->execute($index_data) || die "cache: $field select; ".$self->{dbh}->errstr(); |
102 |
|
|
103 |
|
# XXX for some strange reason, it seems that some entries in my |
104 |
|
# database produce strings which start with null byte. I suspect |
105 |
|
# this to be bug in OpenIsis 0.9.0. |
106 |
|
# This should fix it.. |
107 |
|
$index_data =~ s/^[^\w]+//; |
108 |
$index_data = substr($index_data,0,255); |
$index_data = substr($index_data,0,255); |
109 |
|
|
110 |
my $uc = uc($index_data); |
my $uc = uc($index_data); |
111 |
if (! $c_table->{$field}->{$ident}->{$uc}) { |
if (! $c_table->{$field}->{$ident}->{$uc}) { |
112 |
$sth_cache{$field."insert"}->execute($index_data,$ident,0) || warn "cache: $field insert ($index_data,$ident); ".$self->{dbh}->errstr(); |
$sth_cache{$field."insert"}->execute($index_data,$ident,0) || warn "cache: $field insert ($index_data,$ident); ".$self->{dbh}->errstr(); |
201 |
|
|
202 |
foreach my $table (keys %Table) { |
foreach my $table (keys %Table) { |
203 |
# FIX |
# FIX |
204 |
print STDERR print scalar localtime()."\n"; |
print STDERR "last operation took ",time()-$t," seconds...\n"; |
205 |
|
$t=time(); |
206 |
print STDERR "creating ord for $table...\n"; |
print STDERR "creating ord for $table...\n"; |
207 |
create_ord($table); |
create_ord($table); |
208 |
undef $sth_cache{$table."select"}; |
undef $sth_cache{$table."select"}; |