Skip to content

4.2. Extra: Updating (Database)

shavit edited this page Jan 6, 2018 · 6 revisions

Database updates

Rankings

With the addition of the revamped rankings system (pull request #474, commit a1629d8), bhoptimer received an optimization update.

This update added indexes to the database, and reduced overall I/O for many things. The update only affects new bhoptimer databases and is problematic to apply retroactively. You may manually apply the update by executing the following queries in your database. You may choose to only apply specific parts of this update, but I recommend applying everything.

* Most of the update only applied to MySQL installations. You may manually run those queries on an SQLite database under your own risk. * The table names might be different than yours, if you happen to use your own prefix.

/* chat */
ALTER TABLE chat MODIFY COLUMN auth CHAR(32);
ALTER TABLE chat MODIFY COLUMN ccname CHAR(128);
ALTER TABLE chat MODIFY COLUMN ccmessage CHAR(16);

/* maptiers */
ALTER TABLE maptiers MODIFY COLUMN map CHAR(128);

/* mapzones */
ALTER TABLE mapzones MODIFY COLUMN map CHAR(128);
ALTER TABLE mapzones ADD FULLTEXT INDEX `map` (`map`);

/* playertimes */
ALTER TABLE playertimes MODIFY COLUMN auth CHAR(32);
ALTER TABLE playertimes ADD INDEX `auth` (`auth`);
ALTER TABLE playertimes MODIFY COLUMN map CHAR(128);
ALTER TABLE playertimes ADD FULLTEXT INDEX `map` (`map`);
ALTER TABLE playertimes ADD INDEX `time` (`time`);
ALTER TABLE playertimes ADD INDEX `points` (`points`);
ALTER TABLE playertimes ADD INDEX `style` (`style`);
ALTER TABLE playertimes ADD INDEX `track` (`track`);
ALTER TABLE playertimes ADD INDEX `date` (`date`);

/* users */
ALTER TABLE users MODIFY COLUMN auth CHAR(32);
ALTER TABLE users MODIFY COLUMN name CHAR(32);
ALTER TABLE users MODIFY COLUMN country CHAR(32);
ALTER TABLE users MODIFY COLUMN ip CHAR(64);
ALTER TABLE users ADD INDEX `points` (`points`);