RESULTS
Key takeaways
Columns, not rows
The index is sparse; the key is not unique
The query reads only the necessary columns; compression depends on the type and order of the rows. ORDER BY is the key design decision.
Tag for 8,192 lines. Duplicates are normal; uniqueness is provided by ReplacingMergeTree and FINAL.
We write in batches and hardly ever make changes
A second storage device, not a replacement
INSERT is part of the background merge. Mutations and DELETE operations are rare and resource-intensive.
PostgreSQL as the "source of truth." ClickHouse events and aggregates.
Exercise 4. An Analytical Repository for the Project
Required for the lab: a table of events for your project with a justification for the ORDER BY and PARTITION BY clauses, batch loading, EXPLAIN ESTIMATE for two queries, an MV with an aggregate, three metrics, and a check for duplicate inserts. The solution “analytics in PostgreSQL for now” is acceptable, provided it is subject to review.