From: cheapie Date: Sat, 24 Oct 2015 04:52:45 +0000 (-0500) Subject: Improve rollback database indexing X-Git-Tag: 0.4.14~584 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=380e1504eb2445fd43c03c87d23b8e41e85a7871;p=oweals%2Fminetest.git Improve rollback database indexing Index more columns in the action table of the rollback DB to improve the performance of /rollback_check --- 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;