[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.21, Tue Sep 13 18:32:02 2005 UTC revision 1.22, Wed Sep 14 09:56:58 2005 UTC
# Line 1327  Line 1327 
1327      Trace("Loading table $relationName from $fileName") if T(2);      Trace("Loading table $relationName from $fileName") if T(2);
1328      # Get the database handle.      # Get the database handle.
1329      my $dbh = $self->{_dbh};      my $dbh = $self->{_dbh};
1330        # Get the input file size.
1331        my $fileSize = -s $fileName;
1332      # Get the relation data.      # Get the relation data.
1333      my $relation = $self->_FindRelation($relationName);      my $relation = $self->_FindRelation($relationName);
1334      # Check the truncation flag.      # Check the truncation flag.
# Line 1337  Line 1339 
1339          # leave extra room. We postulate a minimum row count of 1000 to          # leave extra room. We postulate a minimum row count of 1000 to
1340          # prevent problems with incoming empty load files.          # prevent problems with incoming empty load files.
1341          my $rowSize = $self->EstimateRowSize($relationName);          my $rowSize = $self->EstimateRowSize($relationName);
         my $fileSize = -s $fileName;  
1342          my $estimate = FIG::max($fileSize * 1.5 / $rowSize, 1000);          my $estimate = FIG::max($fileSize * 1.5 / $rowSize, 1000);
1343          # Re-create the table without its index.          # Re-create the table without its index.
1344          $self->CreateTable($relationName, 0, $estimate);          $self->CreateTable($relationName, 0, $estimate);
# Line 1361  Line 1362 
1362          $retVal->AddMessage("Table load failed for $relationName using $fileName.");          $retVal->AddMessage("Table load failed for $relationName using $fileName.");
1363          Trace("Table load failed for $relationName.") if T(1);          Trace("Table load failed for $relationName.") if T(1);
1364      } else {      } else {
1365          # Here we successfully loaded the table. Trace the number of records loaded.          # Here we successfully loaded the table.
1366          Trace("$retVal->{records} records read for $relationName.") if T(2);          $retVal->Add("tables");
1367            my $size = -s $fileName;
1368            Trace("$size bytes loaded into $relationName.") if T(2);
1369          # If we're rebuilding, we need to create the table indexes.          # If we're rebuilding, we need to create the table indexes.
1370          if ($truncateFlag && ! $dbh->{_preIndex}) {          if ($truncateFlag && ! $dbh->{_preIndex}) {
1371              eval {              eval {

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3