Skip to content

Commit b643d28

Browse files
authored
Merge pull request #131 from Altinity/sphoorti
SEO updates, cross-links
2 parents 9d35c1f + 886fe71 commit b643d28

File tree

3 files changed

+30
-28
lines changed

3 files changed

+30
-28
lines changed

content/en/altinity-kb-queries-and-syntax/projections-examples.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
---
2-
title: "Projections"
3-
linkTitle: "Projections"
2+
title: "ClickHouse® Projections"
3+
linkTitle: "ClickHouse Projections"
44
description: >
5-
Projections
5+
Using this ClickHouse feature to optimize queries
6+
keywords:
7+
- clickhouse projections
8+
- clickhouse projection vs materialized view
69
---
710

8-
Projections in ClickHouse act as inner tables within a main table, functioning as a mechanism to optimize queries by using these inner tables when only specific columns are needed. Essentially, a projection is similar to a Materialized View with an AggregatingMergeTree engine, designed to be automatically populated with relevant data.
11+
Projections in ClickHouse act as inner tables within a main table, functioning as a mechanism to optimize queries by using these inner tables when only specific columns are needed. Essentially, a projection is similar to a [Materialized View](/altinity-kb-schema-design/materialized-views/) with an [AggregatingMergeTree engine](/engines/mergetree-table-engine-family/aggregatingmergetree/), designed to be automatically populated with relevant data.
912

1013
However, too many projections can lead to excess storage, much like overusing Materialized Views. Projections share the same lifecycle as the main table, meaning they are automatically backfilled and don’t require query rewrites, which is particularly advantageous when integrating with BI tools.
1114

@@ -20,7 +23,7 @@ Projection parts are stored within the main table parts, and their merges occur
2023
* Blog video https://clickhouse.com/videos/how-to-a-clickhouse-query-using-projections
2124

2225

23-
## Why is a projection not used?
26+
## Why is a ClickHouse projection not used?
2427

2528
A query analyzer should have a reason for using projection.
2629

@@ -74,11 +77,8 @@ Expression ((Project names + Projection))
7477

7578
What happens in the case of non-trivial background merges in ReplacingMergeTree, AggregatingMergeTree and similar, and OPTIMIZE table DEDUPLICATE queries?
7679

77-
Before version 24.8, projections became out of sync with the main data.
78-
79-
Since version 24.8, it is controlled by a new table-level setting:
80-
81-
[deduplicate_merge_projection_mode](https://clickhouse.com/docs/en/operations/settings/merge-tree-settings#deduplicate_merge_projection_mode) = 'throw'/'drop'/'rebuild'
80+
* Before version 24.8, projections became out of sync with the main data.
81+
* Since version 24.8, it is controlled by a new table-level setting:<br/>[deduplicate_merge_projection_mode](https://clickhouse.com/docs/en/operations/settings/merge-tree-settings#deduplicate_merge_projection_mode) = `throw`/`drop`/`rebuild`
8282

8383
However, projection usage is still disabled for FINAL queries. So, you have to use OPTIMIZE FINAL or SELECT ...GROUP BY instead of FINAL for fighting duplicates between parts
8484

@@ -165,7 +165,7 @@ where create_table_query ilike '%projection%'
165165

166166
## Examples
167167

168-
### Aggregating projections
168+
### Aggregating ClickHouse projections
169169

170170
```sql
171171
create table z(Browser String, Country UInt8, F Float64)
@@ -224,7 +224,7 @@ Elapsed: 0.005 sec. Processed 22.43 thousand rows
224224

225225
### Emulation of an inverted index using orderby projection
226226

227-
You can create an `orderby projection` and include all columns of a table, but if a table is very wide it will double of stored data. This example demonstrate a trick, we create an `orderby projection` and include primary key columns and the target column and sort by the target column. This allows using subquery to find [primary key values](../../engines/mergetree-table-engine-family/pick-keys/) and after that to query the table using the primary key.
227+
You can create an `orderby projection` and include all columns of a table, but if a table is very wide it will double the amount of stored data. This example demonstrate a trick, we create an `orderby projection` and include primary key columns and the target column and sort by the target column. This allows using subquery to find [primary key values](../../engines/mergetree-table-engine-family/pick-keys/) and after that to query the table using the primary key.
228228

229229
```sql
230230
CREATE TABLE test_a

content/en/altinity-kb-queries-and-syntax/ttl/modify-ttl.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
---
2-
title: "MODIFY (ADD) TTL"
2+
title: "MODIFY (ADD) TTL in ClickHouse®"
33
linkTitle: "MODIFY (ADD) TTL"
44
weight: 100
55
description: >-
6-
What happens during a MODIFY or ADD TTL query.
6+
What happens during a MODIFY or ADD TTL query
7+
keywords:
8+
- clickhouse modify ttl
9+
- clickhouse alter table ttl
710
---
811

912
*For a general overview of TTL, see the article [Putting Things Where They Belong Using New TTL Moves](https://altinity.com/blog/2020-3-23-putting-things-where-they-belong-using-new-ttl-moves).*

content/en/altinity-kb-setup-and-maintenance/altinity-kb-monitoring.md

+13-14
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
title: "ClickHouse® Monitoring"
33
linkTitle: "ClickHouse® Monitoring"
44
description: >
5-
ClickHouse® Monitoring
5+
Tracking potential issues in your cluster before they cause a critical error
6+
keywords:
7+
- clickhouse monitoring
8+
- clickhouse metrics
69
---
710

8-
## ClickHouse® Monitoring
9-
10-
Monitoring helps to track potential issues in your cluster before they cause a critical error.
11-
12-
What to read / watch on subject:
13-
* Altinity webinar "ClickHouse Monitoring 101: What to monitor and how". [recording](https://www.youtube.com/watch?v=W9KlehhgwLw), [slides](https://www.slideshare.net/Altinity/clickhouse-monitoring-101-what-to-monitor-and-how)
14-
* docs https://clickhouse.com/docs/en/operations/monitoring/
11+
What to read / watch on the subject:
12+
* Altinity webinar "ClickHouse Monitoring 101: What to monitor and how". [Watch the video](https://www.youtube.com/watch?v=W9KlehhgwLw) or [download the slides](https://www.slideshare.net/Altinity/clickhouse-monitoring-101-what-to-monitor-and-how).
13+
* [The ClickHouse docs](https://clickhouse.com/docs/en/operations/monitoring/)
1514

1615
## What should be monitored
1716

@@ -38,7 +37,7 @@ The following metrics should be collected / monitored
3837
* [See separate article](../altinity-kb-zookeeper/zookeeper-monitoring/)
3938

4039

41-
## Monitoring tools
40+
## ClickHouse monitoring tools
4241

4342
### Prometheus (embedded exporter) + Grafana
4443

@@ -99,9 +98,9 @@ The following metrics should be collected / monitored
9998
* site24x7 https://www.site24x7.com/plugins/clickhouse-monitoring.html
10099
* Acceldata Pulse https://www.acceldata.io/blog/acceldata-pulse-for-clickhouse-monitoring
101100

102-
### "Build your own" monitoring
101+
### "Build your own" ClickHouse monitoring
103102

104-
ClickHouse allow to access lot of internals using system tables. The main tables to access monitoring data are:
103+
ClickHouse allows to access lots of internals using system tables. The main tables to access monitoring data are:
105104
* system.metrics
106105
* system.asynchronous_metrics
107106
* system.events
@@ -310,13 +309,13 @@ The following queries are recommended to be included in monitoring:
310309
* `SELECT * FROM system.mutations`
311310
* This is the source of information on the speed and progress of currently executed merges.
312311

313-
## Logs monitoring
312+
## Monitoring ClickHouse logs
314313

315-
ClickHouse logs can be another important source of information. There are 2 logs enabled by default
314+
[ClickHouse logs](/altinity-kb-setup-and-maintenance/logging/) can be another important source of information. There are 2 logs enabled by default
316315
* /var/log/clickhouse-server/clickhouse-server.err.log (error & warning, you may want to keep an eye on that or send it to some monitoring system)
317316
* /var/log/clickhouse-server/clickhouse-server.log (trace logs, very detailed, useful for debugging, usually too verbose to monitor).
318317

319-
You can additionally enable system.text_log table to have an access to the logs from clickhouse sql queries (ensure that you will not expose some information to the users which should not see it).
318+
You can additionally enable system.text_log table to have an access to the logs from clickhouse sql queries (ensure that you will not expose some information to the users who should not see it).
320319
```
321320
$ cat /etc/clickhouse-server/config.d/text_log.xml
322321
<yandex>

0 commit comments

Comments
 (0)