Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve rollback database indexing #3286
This change makes the rollback database be indexed on x, y, and z in addition to the previous actor and timestamp. This makes /rollback_check much faster.
I did some testing on a copy of the rollback DB from VanessaE's basic server (1.6 GB, although it did grow to around 2 GB with the extra indexes), and it reduced the approximate time for a /rollback_check in many areas from ~10s to <100ms.
As far as the concern of row insertion performance, est31 and I did some performance tests, and couldn't find a significant difference.
Note that this does not affect existing databases, only newly created ones (although it is backwards- and forwards-compatible). The following SQL commands would have the same effect on an existing DB:
DROP INDEX actionActor;
For the protocol: this is how the "saving" was measured: https://github.com/est31/minetest/tree/rollback_speedmeasure