Civcraft / NameLayer

Do not open issues here; open them on the maintained fork @ DevotedMC
https://github.com/DevotedMC/NameLayer
BSD 3-Clause "New" or "Revised" License
4 stars 14 forks source link

Name_player incorrect index #214

Open erocs opened 8 years ago

erocs commented 8 years ago

Currently Name_player is created with a unique index on (uuid, player) and no primary key. Instead, it should have a unique index on (uuid) to prevent duplicate UUID mappings, change the existing (uuid, player) index to be non-unique for supporting player lookups by uuids, and add a non-unique (player, uuid) index to facilitate uuid lookups by player name. The latter two are non-unique to speed up operations and because the UUIDs are always unique these entries will always be as well.

A primary key should not be used on this table because that would force record ordering. For random data like uuids, that would cause the table to be rebuilt often to create space for new rows in the ordering.

Maxopoly commented 8 years ago

I added one manually after we talked about it, might need to remember that when we automate adding one.