Skip to content
Theory · ClickHouse: Columns, MergeTree, Sort Key, Partitions · lesson 1 of 13

Rows and columns

A sale's row is cut by column into seven tapes; only the price and quantity tapes are unwound for the SUM, the rest stay on the shelf

In the ledger from the MVCC chapter, each line is one whole sale: the order number, the time, the shop, the drink, the quantity, the price, the payment method. That suits the cashier: ring up a sale and a line is added, get asked about an order and one line is read. The analyst at the end of the month needs something else: a total over all the sales.

In this lesson

  • OLTP and OLAP
  • What a query reads
  • Compression
  • The cost of one row
  • The chapter's exercises
  • Common mistake
  • Key points