Skip to content
Snippets Groups Projects
Commit d7308ea6 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- added index to db

parent 49ee4845
No related branches found
No related tags found
No related merge requests found
...@@ -232,9 +232,7 @@ SQL_DC_PLAN ...@@ -232,9 +232,7 @@ SQL_DC_PLAN
############################################################################### ###############################################################################
sub write_index_creation($dbh) { sub write_index_creation($dbh) {
my $sql=<<"SQL_INDEX"; my $sql=<<"SQL_INDEX";
-- BEGIN; CREATE UNIQUE INDEX aip_index on aip (ie_id);
-- CREATE UNIQUE INDEX aip_index on aip (ie_id);
-- COMMIT;
SQL_INDEX SQL_INDEX
my $sth = $dbh->prepare($sql); my $sth = $dbh->prepare($sql);
$sth->execute() or die "sql problem detected", $dbh->errstr; $sth->execute() or die "sql problem detected", $dbh->errstr;
...@@ -520,6 +518,7 @@ sub searching_ie_files ($dir, $tmp_ies_unsorted_file) { ...@@ -520,6 +518,7 @@ sub searching_ie_files ($dir, $tmp_ies_unsorted_file) {
write_database_creation($dbh); write_database_creation($dbh);
write_tables_creation($dbh); write_tables_creation($dbh);
write_prepare_insert($dbh); write_prepare_insert($dbh);
write_index_creation($dbh);
while( <$fh_truncated_IEs> ) { while( <$fh_truncated_IEs> ) {
chomp; chomp;
print $progressbar->report("parse IE files: %40b ETA: %E \r", $count++); print $progressbar->report("parse IE files: %40b ETA: %E \r", $count++);
...@@ -528,7 +527,7 @@ sub searching_ie_files ($dir, $tmp_ies_unsorted_file) { ...@@ -528,7 +527,7 @@ sub searching_ie_files ($dir, $tmp_ies_unsorted_file) {
write_addsql($dbh, $ret); write_addsql($dbh, $ret);
} }
say ""; say "";
write_index_creation($dbh);
$dbh->disconnect or warn("disconnecting problems, ", $dbh->errstr); $dbh->disconnect or warn("disconnecting problems, ", $dbh->errstr);
say "processed $count uniq IEs"; say "processed $count uniq IEs";
} else { } else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment