best mysql data types for space reduction and performance increase
I search through google a bit and found a few decent articles, but not really what I needed. I'm trying to find the best data-types to use for:
- data-type f开发者_开发技巧or 10 int length
- data-type for 1 int length 0-9
- data-type for int of 1 or 0
- data-type for string of 32 chars
- data-type for string of 255 chars
I guess my overall question is what data-types should I use to reduce space since the cost per GB is ~$6. Though I also don't want to sacrifice CPU performance just to save a byte.
int
orbigint
, depending on just how big the 10-digit numbers are (unsigned
if it makes sense)tinyint
boolean
(not nullable)varchar(32)
varchar(255)
精彩评论