November 5th, 2000, 10:30 AM
i'd been looking forward to getting into DBMS work, but i keep getting stuck at not knowing how to figure out the lengths or widths that should be set for fields or columns.
o too small, and you've cut off some data
o too big, and you're wasting storage-space (and maybe lagging the db on the performance side?), especially if you get a massive number of rows.
seems better to choose towards "too big" fields or columns, but what to you guys use for figuring this out?
(guessing there's no field-sizes sliderule, but hoping to get something enough to get over this hook.)
November 6th, 2000, 07:26 AM
If you are talking about strings? ... just use VARCHAR() - they won't waste space.
... Sooo defining a VARCHAR(250) field wont't take up 250 bytes - only the bytes the string is long ...
November 6th, 2000, 11:28 PM
CHAR() columns store the exact width you define them as.
You can use TEXT or BLOB and not waste space, right? It only stores the length of the text plus one byte for end of string...