From fd70c60005d52277f4e7c056f626fd56ad8dcffb Mon Sep 17 00:00:00 2001 From: cheapie Date: Fri, 23 Oct 2015 23:52:45 -0500 Subject: [PATCH] Improve rollback database indexing Index more columns in the action table of the rollback DB to improve the performance of /rollback_check --- src/rollback.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/rollback.cpp b/src/rollback.cpp index a6b79393a..be4d1a8c2 100644 --- a/src/rollback.cpp +++ b/src/rollback.cpp @@ -240,8 +240,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;