Hi HANA devs,
lets assume 2 column based table definitions: (c40 = 40 chars width, n3 = 3 digits width, uVal = value (unique by unique index))
Table T1:
Name (c40) | City (c40) | Age (n3) |
---|---|---|
Smith | Boston | 38 |
Kline | Boston | 41 |
Table T2:
Name (c40) | Size (n3) |
---|---|
Smith | 190 |
Kline | 176 |
Does HANA store these two tables internally like ... ?
Table T1_Col_1
Key | uVal |
---|---|
1 | Smith |
2 | Kline |
Table T1_Col_2
Key | uVal |
---|---|
1 | 38 |
2 | 41 |
Table T2_Col_1
Key | uVal |
---|---|
1 | Smith |
2 | Kline |
Table T2_Col_2
Key | uVal |
---|---|
1 | 190 |
2 | 176 |
--> This assumes a "per table" columnar design, good compression if original tables containing enough duplicate values to squeeze out.
Several years before HANA, we emulated a "columnar" design in a row based DB by normalizing all DB tables to a small amount of technical key/value tables grouping the values just by technical datatypes. With this approach ("store together, what's technically the same type"), the 2 tables could be stored like
Table T_c40
Key | uVal_c40 |
---|---|
1 | Smith |
2 | Kline |
3 | Boston |
Table T_n3
Key | uVal_n3 |
---|---|
1 | 38 |
2 | 41 |
3 | 190 |
4 | 176 |
--> This assumes a "per database" columnar design, allows much more potentional duplicates to be squeezed out
We also tried a design with just one data storage table (besides the index tables to link the T_uVal entries to its original tables) like ...
Table T_uVal
Key | uVal |
---|---|
1 | Smith |
2 | Kline |
3 | Boston |
4 | 38 |
5 | 41 |
6 | 190 |
7 | 176 |
--> we got all the "really unique" values in one big table now.
How is this done internally right now ?
Thanks for clarification,
Matthias