Civcraft / Citadel

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

Unordered columns from ordered fields (reinforcement_id(chunk_id)) #130

Open psygate opened 8 years ago

psygate commented 8 years ago

reinforcement_id(chunk_id) imposes an unnatural ordering on the x,z and world coordinates of a chunk. It also introduces an update anomaly by storing the world part of a reinforcement doubly. The easiest solution is to introduce a chunk_x, chunk_z field and query those combined with the already existent world field. chunk_x and chunk_z are always integer and can thus be efficiently be ordered and searched for in a database. Strings/varchars are unnecessarily introducing a much larger and ill-bounded search space which the optimizer has to take into account.

ProgrammerDan commented 8 years ago

This has some merit, impacts chunkLoad and chunkSave cache-fill methods.