1. Insert writes a part
Each INSERT writes one new immutable part on disk.
INSERT INTO events VALUESTyporithm · medium
Step 1 of 8 · intro card
Columns & Engines
Each INSERT writes a new immutable part; ClickHouse merges parts in the background, and OPTIMIZE ... FINAL forces a merge.
MergeTree never updates rows in place — every INSERT creates a new sorted, immutable part.
A background process continuously merges small parts into larger ones, reclaiming space and keeping reads fast.
OPTIMIZE TABLE ... FINAL forces an immediate full merge, but it is expensive and meant for occasional maintenance.
INSERT = one new immutable part.
Background merges combine parts.
OPTIMIZE FINAL forces a merge (costly).
INSERT INTO events VALUES
('2026-06-01', 42, 'click', 1.5),
('2026-06-01', 42, 'view', 0.0);
OPTIMIZE TABLE events FINAL;Connect each part of the code to the concept before you type.
Each INSERT writes one new immutable part on disk.
INSERT INTO events VALUESSend many rows per INSERT to avoid creating too many tiny parts.
('2026-06-01', 42, 'click', 1.5),
('2026-06-01', 42, 'view', 0.0)FINAL forces parts to merge now — costly, use rarely.
OPTIMIZE TABLE events FINALRead the concept map and follow the code breakdown.
Type the implementation, repair mistakes and work through every recall exercise.
Use the final check without hints; revisit weak concepts in short practice sessions.