4 ms·
This is also multiplied by the character encoding, so when you have a table with 10 columns at VARCHAR(255) because your too lazy to define them, and they are a
by ronaldbradford 18y ago
This is also multiplied by the character encoding, so when you have a table with 10 columns at VARCHAR(255) because your too lazy to define them, and they are all UTF8, so that's 255*3 for each column for each row when used in a MySQL Internal buffer (not, these buffers may or may not be used depending on the type of query).
When you have 100s to 1000s of queries per second, knowing and using your memory wisely is very important, because MySQL unlike Oracle for example, does not cap the amount of memory used for the Process, again using the Oracle approach the PGA (Process Global Area).
It's always easy to take sort cuts in design, when your DB will never grow above a few GB's and your users will never grow above say 10.
VARCHAR(255) is just as much a sign of little to no design, and therefore this and many other beginner 101 mistakes are likely, and therefore large performance gains are generally easily made in a system that now is needed to perform.
- gaius 18y agoKinda the point of UTF encoding is it's variable-width; if you only need ASCII then that's all you'll store. The MySQL people seem to have chosen to use the worst possible case every time regardless; this is not a "feature".