swecrets

Reading ClickHouse

Mechanics

Build the mental model of how ClickHouse presents itself — what it exposes to the operator, how data gets in, and what happens when a query runs. Read-along only; no setup required.

What this module covers

  • The system database (system.tables, system.processes, system.query_log)
  • INSERT mechanics and batching
  • Input/output formats (CSV, JSONEachRow, Native, Parquet)
  • Query execution lifecycle — parse, analyze, plan, execute
  • Vectorized execution (block-based processing)
  • MergeTree engine (first mention)
  • Sparse primary index (first encounter)
  • EXPLAIN as a diagnostic tool
  • Approximate aggregate functions (uniq, quantile)

Lessons

  1. 1. The system Database: Your Window Into What's Happening14 min
  2. 2. Loading Data: INSERT, Formats, and What Actually Happens14 min
  3. 3. SELECT Execution: A Lifecycle Tour15 min
  4. 4. Your First Surprise: Why the "Wrong" Index Is Fine Here15 min