Skip to content

Commit

Permalink
Improve rollback database indexing
Browse files Browse the repository at this point in the history
Index more columns in the action table of the rollback DB to improve the performance of /rollback_check
  • Loading branch information
cheapie authored and est31 committed Oct 24, 2015
1 parent f9eb31f commit 380e150
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/rollback.cpp
Expand Up @@ -242,8 +242,7 @@ bool RollbackManager::createTables()
" FOREIGN KEY (`oldNode`) REFERENCES `node`(`id`),\n"
" FOREIGN KEY (`newNode`) REFERENCES `node`(`id`)\n"
");\n"
"CREATE INDEX IF NOT EXISTS `actionActor` ON `action`(`actor`);\n"
"CREATE INDEX IF NOT EXISTS `actionTimestamp` ON `action`(`timestamp`);\n",
"CREATE INDEX IF NOT EXISTS `actionIndex` ON `action`(`x`,`y`,`z`,`timestamp`,`actor`);\n",
NULL, NULL, NULL));
verbosestream << "SQL Rollback: SQLite3 database structure was created" << std::endl;

Expand Down

0 comments on commit 380e150

Please sign in to comment.