Why is the size of my MySQL database larger than the individual values would indicate? -
I am accumulating two columns of unsigned integer (which should be 4 bytes according to each) and I Table for close rows * 8 bytes of individual table files (which are with IBD extensions, correct me, if I am thinking this wrong) starting with 96 KB for all my small tables, as I have a large number of rows Table with I come not, size dramatically increases and are also around one per line byte 30, as shown in a table to lines 2 ^ and a table for each K first column is the primary key.
+ -------- + ------------ + --------- - + ------ ------- + ------------- + | Size k | Rows | KB | Byte | B / R | + -------- + ------------ + ---------- + ------------- + - - ---------- + | 1 | 2 | 96 | 98304 | 49152 | | 2 | 4 | 96 | 98304 | 24576 | | 3 | 8 | 96 | 98304 | 12288 | | 4 | 16 | 96 | 98304 | 6144 | | 5 | 32 | 96 | 98304 | 3072 | | 6 | 64 | 96 | 98304 | 1536 | | 7 | 128 | 96 | 98304 | 768 | | 8 | 256 | 96 | 98304 | 384 | | 9 | 512 | 96 | 98304 | 192 || | 10 | 1024 | 128 | 131072 | 128 | | 11 | 2048 | 160 | 163840 | 80 | | 12 | 40 9 6. 208 | 212992 | 52 | | 13. 8192 | 336 | 344064 | 42 | | 14 | 16384 | 560 | 573440 | 35 | 15 | 32768 | 9216 | 9437184 | 288 | | 16 | 65536 | 10240 | 10485760 | 160 | | 17 | 131072 | 12288 | 12582912 | 96 | | 18 | 262144 | 15360 | 15728640 | 60 | | 19 | 524288 | 23552 | 24117248 | 46 | | 20 | 1048576 | 40 9 60 41 9 4,440 40 | | 21 | 20 9 7152 | 69632 | 71303168 | 34 | 22 | 4194304 | 131072 | 134217728 | 32 | | 23 8388608 | 253952 | 260046848 | 31 | | 24 | 16777216 | 499712 | 511705088 | 30.5 | | 25 | 33554432 | 995328 | 101 9 215872 | 30.375 | | 26 | 67108864 | 1978368 | 2025848832 | 30.1875 | | 27 | 134217728 | 3948544 | 404330 9 56. 30.125 | | 28 | 268435456 | 78 9 92 9 | 8082423808 | 30.109375 | | 29 | 536870 9 12 | 157736 9 6. 16152264704 | 30.0859375 | | 30 | 1073741824 | 315432 9 6. 32300335104 | 30.08203125 | | 31 | 2147483648 | 63074304 | 645880872 9 6. 30.07617188 | + -------- + ------------ + ---------- + ------------- + - - ---------- +
And I know that these tables are stored in compact format and according to the database the average length is about 28 bytes. Most tables For (not 30). Transaction ID field = 6 = 6 bytes Roll Point Field = 7 = 7 HEADER = 5 + CEILING (N / 8) + 1 = 7 bytes = 2 = N = 1 tap 2 Bytes primary key (yes) = 0? = 0 bytes actual data (2UINTS) = 8 bytes -------------------------------------- ---- = 28 bytes
I did a lot of research, because I started this question and answered my big questions, but to make sure I got the second of the eyes Setting should look at this right, besides, where are the other 2 bytes coming from?
Comments
Post a Comment