开发者

best mysql data types for space reduction and performance increase

开发者 https://www.devze.com 2023-04-13 01:06 出处:网络
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:

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:

  1. data-type f开发者_开发技巧or 10 int length
  2. data-type for 1 int length 0-9
  3. data-type for int of 1 or 0
  4. data-type for string of 32 chars
  5. 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.


  1. int or bigint, depending on just how big the 10-digit numbers are (unsigned if it makes sense)
  2. tinyint
  3. boolean (not nullable)
  4. varchar(32)
  5. varchar(255)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号