Why MySQL allocates a fixed memory types?

0 like 0 dislike
5 views
For example, under the type int is allocated 4 bytes, although it may be number 5, which takes 3 bits
Why this happens dynamically, so there is no leakage in the case of small numbers?
by | 5 views

1 Answer

0 like 0 dislike
Excuse me, but how does the CPU know what You were referring to the number 5?
I mean here he is running on memory stumbles upon a sequence of bits each beat of your life. How will he know what you wanted exactly three bits under the number to allocate? He'll need some hint, say some piece of memory, where you will write the number 3 (bits), right? But number 3 is actually two bits (11) in binary. And as he to guess that you in the tip, exactly 2 bits used? Understand what is the problem?

And in General
by

Related questions

0 like 0 dislike
4 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
7 answers
asked Mar 21, 2019 by Artqookie
110,608 questions
257,186 answers
0 comments
33,700 users