Calculating storage requirements for in-memory tables
The general formula for the space required for an in-memory table (M-table) is:
table_size + sum_of(index_size)
table_size = 1.3 x rows x (sum_of(col_size) + (3 x word_size) + (2 * num_cols) + 2)
where:
rows is the number of rows
sum_of(col_size) is the sum of the sizes of the columns
word_size is the machine word size (for example, 4 bytes for a 32-bit operating system and 8 bytes for a 64-bit operating system)
num_cols is the number of columns
For each in-memory index, the index size is 1.3 x rows x ((dist_factor x sum_of(col_sizes + 1)) + (8 x word_size) + 4)
where dist_factor is a value between 1.0 and 2.0 that depends upon the distribution of the key values. If key values are highly dissimilar, use a value closer to 2.0. If key values are highly similar, use a value closer to 1.0.