MySQL vs for()
#10

Alright, sorry for the late reply, been busy.

Quote:
Originally Posted by Vince
View Post
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, ...).
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.

Quote:
Originally Posted by PrO.GameR
View Post
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.
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.
Reply


Messages In This Thread
MySQL vs for() - by corne - 14.12.2016, 15:34
Re: MySQL vs for() - by Vince - 14.12.2016, 16:04
Re: MySQL vs for() - by PrO.GameR - 14.12.2016, 19:38
Re: MySQL vs for() - by SickAttack - 14.12.2016, 19:46
Re: MySQL vs for() - by CodeStyle175 - 14.12.2016, 20:22
Re: MySQL vs for() - by NeXoR - 14.12.2016, 20:33
Re: MySQL vs for() - by SickAttack - 14.12.2016, 21:18
Re: MySQL vs for() - by NeXoR - 15.12.2016, 17:24
Re: MySQL vs for() - by SickAttack - 16.12.2016, 00:14
Re: MySQL vs for() - by corne - 17.12.2016, 12:05

Forum Jump:


Users browsing this thread: 2 Guest(s)