17.12.2016, 12:05
Alright, sorry for the late reply, been busy.
That's exactly what I have. I just didn't see the point in my mentioning it as it was somewhat unrelevant to the question because only the objects are updated on a save, nothing happens to the `maps` table.
Well, to be honest comparing strings in MySQL is not that problematic, while it's generally recommended to use an INT I believe that's mostly because strings are prone to change, while an unique id doesnt. I'm not saying that there isn't a performance difference between the two, but it's not that problematic, especially not in this situation where it's only loaded on start and saved after an edit. I did change it to use an unique id instead as the main reason I started with a varchar was out of laziness.
---
Either way, thanks for all the input.
Quote:
Sorry what? I'm not really following. It sounds like your tables aren't properly normalized. If you have many maps and each map can have many objects then you need two tables: one that declares the map properties (id, name, author, creation date, whatever) and another one that is linked to it that stores the actual objects (id, mapid, modelid, x, y, z, ...).
|
Quote:
I'm sorry but why on earth would you save a mapname on object instead of it's mysql index?
As a rule of thumb you should index things whenever possible instead of using string comparison. |
---
Either way, thanks for all the input.