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.
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.