Today the company has a MySQL share, do a record, perhaps a lot of things very simple, but it is difficult for people who do not know
1. Store with minimal cost
For example, if you can determine that a field is stored in numbers, and the number must be no more than 127 or 255, then you should use tinyint instead of int
When you store integer types, each type takes on a different byte:
tinyint 1smallint 2mediumint 3int 4bigint 8 Additional order for enumeration information no meaning in shaping parentheses the number is unintentional Righteousness 2. Decimal (n,m) for rounding out the part after the decimal point, maximum value n 1-65 m 0-30
Based on the above theory, there is no need to consider overflow due to database limitations because a 65-bit shaping cannot be handled in Java
3. Character keystroke long char (n) 0,255 unit char is defined as 0, only null and empty string can be placed to be longer varchar (n) 255*255 unit char actually UTF-8 can store 64K/3 varchar
MySQL Share record