From 380e1504eb2445fd43c03c87d23b8e41e85a7871 Mon Sep 17 00:00:00 2001 From: cheapie Date: Fri, 23 Oct 2015 23:52:45 -0500 Subject: 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(-) (limited to 'src/rollback.cpp') diff --git a/src/rollback.cpp b/src/rollback.cpp index 3d264b880..2367c3a21 100644 --- a/src/rollback.cpp +++ b/src/rollback.cpp @@ -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; -- cgit v1.2.3