Skip to content

Commit 380e150

Browse files
cheapieest31
authored andcommittedOct 24, 2015
Improve rollback database indexing
Index more columns in the action table of the rollback DB to improve the performance of /rollback_check
1 parent f9eb31f commit 380e150

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎src/rollback.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,7 @@ bool RollbackManager::createTables()
242242
" FOREIGN KEY (`oldNode`) REFERENCES `node`(`id`),\n"
243243
" FOREIGN KEY (`newNode`) REFERENCES `node`(`id`)\n"
244244
");\n"
245-
"CREATE INDEX IF NOT EXISTS `actionActor` ON `action`(`actor`);\n"
246-
"CREATE INDEX IF NOT EXISTS `actionTimestamp` ON `action`(`timestamp`);\n",
245+
"CREATE INDEX IF NOT EXISTS `actionIndex` ON `action`(`x`,`y`,`z`,`timestamp`,`actor`);\n",
247246
NULL, NULL, NULL));
248247
verbosestream << "SQL Rollback: SQLite3 database structure was created" << std::endl;
249248

0 commit comments

Comments
 (0)
Please sign in to comment.