While calculating the storage requirements in NDB, extra
consideration is needed when calculating storage requirement for
NDB tables. For tables using the NDB cluster storage engine,
there is the factor of 4 – byte alignment to be taken into
account when calculating storage requirements. This means that
all NDB data storage is done in multiples of 4 bytes.
For Example, let’s say if a column takes 14 bytes to store. In
NDB it requires 16 bytes to store. 2bytes will be padding.
Because of this only in NDB TINYINT, SMALLINT, MEDUMINT, and INT
all require 4 bytes storage per record due to the alignment
factor. This rule is not applied in case of BIT data type.
BIT(X) – in NDB storage engine this column will take X bite of
storage space, if a table definition contains 1 or more BIT
column (up to 32 BIT columns) then NDB Cluster reserves 4 Bytes
(32 bytes) per row for these . If the table definition contains
more than 32 BIT …
[Read more]