Skip to content

Commit 211e1d8

Browse files
committed
small edits
1 parent 75a8472 commit 211e1d8

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

docs/data-modeling/projections/2_materialized-views-versus-projections.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,15 @@ You should consider using materialized views when:
4747

4848
You should consider avoiding use of materialized views when:
4949

50-
- **High ingestion throughput is critical**: Especially for high-velocity streaming data with small, frequent batches, as synchronous materialized view updates can significantly degrade insert performance. This is because successive blocks of inserted data will have to wait until each materialized view is finished transforming the current blocks data for insertion into the materialized view's target table.
51-
- **Source data is frequently updated or deleted**: Without additional strategies for handling consistency between the source and target tables, incremental materialized views will become stale and inconsistent.
50+
- **Source data is frequently updated or deleted**: Without additional strategies for handling consistency between the source and target tables, incremental materialized views could become stale and inconsistent.
5251
- **Simplicity and automatic optimization are preferred**: If you want to avoid managing separate target tables.
5352

5453
### When to choose projections {#choosing-projections}
5554

5655
You should consider using projections when:
5756

58-
- **Optimizing queries for a single table**: Your primary goal is to accelerate queries on a single base table by providing alternative sorting orders, optimizing filters on columns which are not part of the primary-key, or pre-computing aggregations for a single table.
59-
- You want **query transparency**: You want queries to target the original table without modification, relying on ClickHouse to pick the best data layout for a given query.
60-
- **High ingestion throughput is a priority**: Projections' asynchronous updates generally have less direct impact on write performance compared to materialized views.
61-
- **Data is predominantly append-only or immutably managed**: or if your `DELETE` strategy can effectively leverage the `lightweight_mutation_projection_mode` (v24.7+)
57+
- **Optimizing queries for a single table**: Your primary goal is to speed up queries on a single base table by providing alternative sorting orders, optimizing filters on columns which are not part of the primary-key, or pre-computing aggregations for a single table.
58+
- You want **query transparency**: you want queries to target the original table without modification, relying on ClickHouse to pick the best data layout for a given query.
6259

6360
### When to avoid projections {#avoid-projections}
6461

@@ -68,19 +65,20 @@ You should consider avoiding use of projections when:
6865
- **Explicit filtering of materialized data is needed**: Projections do not support `WHERE` clauses in their definition to filter the data that gets materialized into the projection itself.
6966
- **Non-MergeTree table engines are used**: Projections are exclusively available for tables using the `MergeTree` family of engines.
7067
- `FINAL` queries are essential: Projections do not work with `FINAL` queries, which are sometimes used for deduplication.
68+
- Working with large tables that grow quickly:
7169

7270
## Summary {#summary}
7371

7472
Materialized views and projections are both powerful tools in your toolkit for
7573
optimizing queries and transforming data, and in general, we recommend not to view
76-
using them as an either/or choice. Instead, they can be used together to get the
77-
most out of your queries. As such, the choice between materialized views and
78-
projections in ClickHouse really depends on your specific use case and access
79-
patterns.
74+
using them as an either/or choice. Instead, they can be used in a complementary
75+
manner to get the most out of your queries. As such, the choice between materialized
76+
views and projections in ClickHouse really depends on your specific use case and
77+
access patterns.
8078

8179
As a general rule of thumb, you should consider using materialized views when
8280
you need to aggregate data from one or more source tables into a target table or
83-
perform complex transformations. Materialized views are excellent for shifting
81+
perform complex transformations at scale. Materialized views are excellent for shifting
8482
the work of expensive aggregations from query time to insert time. They are a
8583
great choice for daily or monthly rollups, real-time dashboards or data summaries.
8684

0 commit comments

Comments
 (0)