import-/prune-trace: primary keys reordered

data_address is definitely part of the unique key to trace entries, but
instr2 is arbitrary (could be instr1, time1 or time2 as well).  Moving
data_address up the hierarchy to speed up certain FSP experiments.

Change-Id: I37a1f6c1e5b3957ba2f5bf46e0cd1a9c4aa7bfef
This commit is contained in:
Horst Schirmeier
2013-05-28 11:37:35 +02:00
parent 12aec4c1a4
commit 501384b0f4
2 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ bool Importer::create_database() {
" data_address int(10) unsigned NOT NULL,"
" width tinyint(3) unsigned NOT NULL,"
" accesstype enum('R','W') NOT NULL,"
" PRIMARY KEY (variant_id,instr2,data_address)"
" PRIMARY KEY (variant_id,data_address,instr2)"
") engine=MyISAM ";
return db->query(create_statement.c_str());
}

View File

@ -59,7 +59,7 @@ bool Pruner::create_database() {
" data_address int(10) unsigned NOT NULL,"
" fspmethod_id int(11) NOT NULL,"
" PRIMARY KEY (id),"
" KEY fspmethod_id (fspmethod_id,variant_id,instr2,data_address)"
" KEY fspmethod_id (fspmethod_id,variant_id,data_address,instr2)"
") engine=MyISAM ";
bool success = (bool) db->query(create_statement.c_str());
if (!success) return false;
@ -70,7 +70,7 @@ bool Pruner::create_database() {
" data_address int(10) unsigned NOT NULL,"
" fspmethod_id int(11) NOT NULL,"
" pilot_id int(11) NOT NULL,"
" PRIMARY KEY (variant_id, instr2, data_address, fspmethod_id, pilot_id),"
" PRIMARY KEY (variant_id, data_address, instr2, fspmethod_id, pilot_id),"
" KEY joinresults (pilot_id,fspmethod_id)) engine=MyISAM";
return db->query(create_statement.c_str());