SAP / SAP Mid Level (3 to 8 yrs) Interview questions
Why does HANA favor columnar storage for analytical workloads?
An analytical query like SUM(amount) GROUP BY region only needs two of a table's many
columns. In row store, the database still has to read every full row from disk/memory (including every
column it doesn't need) just to extract those two fields, since a row's data is stored together as one
contiguous unit. In column store, only the specific columns actually referenced by the query need to be
touched at all — the rest of the table's data isn't read.
flowchart TD
A[Query needs region, amount only] --> B{Row Store}
A --> C{Column Store}
B --> D[Reads every column of every row, discards unneeded ones]
C --> E[Reads only the region and amount columns directly]
This selective column access, combined with columnar data's tendency to compress extremely well (since values within one column are often repetitive — the same region name appearing thousands of times, for instance), is what gives column store its major performance advantage specifically for the aggregate-heavy, few-columns-many-rows access pattern typical of analytical reporting.
More Related questions...
