Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve rollback database indexing #3286

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
3 participants
@cheapie
Copy link
Contributor

commented Oct 24, 2015

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;
DROP INDEX actionTimestamp;
CREATE INDEX actionIndex ON action(x,y,z,timestamp,actor);

@est31

This comment has been minimized.

Copy link
Contributor

commented Oct 24, 2015

👍

@est31 est31 added the enhancement label Oct 24, 2015

Improve rollback database indexing
Index more columns in the action table of the rollback DB to improve the performance of /rollback_check
@est31

This comment has been minimized.

Copy link
Contributor

commented Oct 24, 2015

For the protocol: this is how the "saving" was measured: https://github.com/est31/minetest/tree/rollback_speedmeasure

@kwolekr

This comment has been minimized.

Copy link
Contributor

commented Oct 24, 2015

👍

@est31

This comment has been minimized.

Copy link
Contributor

commented Oct 24, 2015

@est31 est31 closed this Oct 24, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.