I have a table whose size I would like to preserve, and one of the columns can be considered as a 5-byte unsigned integer. This is a column that I will not look for.
MySQL offers integer data types
TINYINT, for 1-byte integersSMALLINT for 2 byte integersMEDIUMINT, for 3-byte integersINT, for 4 byte integersBIGINT for 8 byte integers.
But he also suggests BIT(M), for 1 ≤ M ≤ 64. This saves (effectively) an unsigned integer from 0 to 2 M-1 . Is there any reason to avoid using a column BIT(40)to store a 5-byte integer? (As I said, I do not need to search on this column. Therefore, any difficulties associated with the speed of query execution can be ignored.)
source
share