5 ms·
You saved 5 cents and now your code is not readable
- julius_geezer 16y agoWait, MySQL stores the field names with every record? Oracle doesn't do that; Postgres doesn't do that. The documentation I can pull up with five minutes of Googling strongly suggests that InnoDB doesn't do that. So as far as I know MRLCN's savings over MY_RIDICULOUSLY_LONG_COLUMN_NAME gets paid once, in the table header, whether the table has 1 row on 100 million.
- wanderr 16y agoUnless you read the article he linked to before delving into his rant, it's very unclear that he's talking about MongoDB, not MySQL. You are correct that InnoDB and as far as I know all other MySQL engines, does not store field names with every record.
- wanderr 16y agoMongo technically only requires indexes to fit in memory, but in practice if your data doesn't fit in memory, performance is abysmal. We also use short names, but find that it's not terrible for readability because we use class constants representing each name, so what's the key for a playlist name? Why it's Playlist::KEY_NAME. We also have a function that renames the fields from their short mongo names to their full names when they get loaded in, so the vast majority of the time, nobody even needs to worry about the mongo key names.