[Bio] / Sprout / ERDB.pm Repository:
ViewVC logotype

Diff of /Sprout/ERDB.pm

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

revision 1.18, Sun Aug 14 23:32:08 2005 UTC revision 1.19, Fri Sep 9 14:50:58 2005 UTC
# Line 9  Line 9 
9      use DBObject;      use DBObject;
10      use Stats;      use Stats;
11      use Time::HiRes qw(gettimeofday);      use Time::HiRes qw(gettimeofday);
12        use FIG;
13    
14  =head1 Entity-Relationship Database Package  =head1 Entity-Relationship Database Package
15    
# Line 1304  Line 1305 
1305      # Check the truncation flag.      # Check the truncation flag.
1306      if ($truncateFlag) {      if ($truncateFlag) {
1307          Trace("Creating table $relationName") if T(2);          Trace("Creating table $relationName") if T(2);
1308            # Compute the row count estimate. We take the size of the load file,
1309            # divide it by the estimated row size, and then multiply by 1.5 to
1310            # leave extra room. We postulate a minimum row count of 1000 to
1311            # prevent problems with incoming empty load files.
1312            my $rowSize = $self->EstimateRowSize($relationName);
1313            my $fileSize = -s $fileName;
1314            my $estimate = FIG::max($fileSize * 1.5 / $rowSize, 1000);
1315          # Re-create the table without its index.          # Re-create the table without its index.
1316          $self->CreateTable($relationName, 0);          $self->CreateTable($relationName, 0, $estimate);
1317          # If this is a pre-index DBMS, create the index here.          # If this is a pre-index DBMS, create the index here.
1318          if ($dbh->{_preIndex}) {          if ($dbh->{_preIndex}) {
1319              eval {              eval {

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3