I am studying the mysql testing guide. in the Data type bit section:
a BIT (4) sores 4 bits per value
and that the storage requirement for column BIT (n) is (n + 7) / 8. I do not understand this part. shldnt BIT (4) takes up only 4 bits of memory?
This is actually a clumsy way to round the result. This means that BIT (1) - BIT (8) takes 1 byte, BIT (9) - BIT (16) takes 2 bytes, etc. There is no overhead for 7 bits. Divide the number of bits by 8 and round the result. BIT (4) will accept 1 byte.
It seems that the overhead of 7 bits is likely to identify the memory block as BIT storage.
7 , BIT (n), 8, . (n + 7)/8 BYTES
, 4 2 . "", , .
Source: https://habr.com/ru/post/1715808/More articles:Disable or ignore mousedown in select field in firefox - javascriptLooking for an alternative to .NET CryptoStream? - c #stable match - algorithmJava Stringparsing ั Regexp - javaGNU screen: `` quote programmer '' in Readbuf? - gnu-screenLua ะดะตัััะธัะฝัะน ะทะฝะฐะบ? - functionGNU Screen: environment variables - environment-variablesXSLT: complex conversions, sentences? - xmlHow to display custom asp.net compilation error message - asp.netStructureMap AlwaysUnique does not work with constructor injection - structuremapAll Articles