From 886fe7101ff7bb1ced98397f998b3188711f7b36 Mon Sep 17 00:00:00 2001 From: Doug Tidwell Date: Wed, 5 Mar 2025 11:27:11 -0500 Subject: [PATCH] SEO updates, cross-links --- .../projections-examples.md | 24 ++++++++--------- .../ttl/modify-ttl.md | 7 +++-- .../altinity-kb-monitoring.md | 27 +++++++++---------- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/content/en/altinity-kb-queries-and-syntax/projections-examples.md b/content/en/altinity-kb-queries-and-syntax/projections-examples.md index 513183172b..10e379557f 100644 --- a/content/en/altinity-kb-queries-and-syntax/projections-examples.md +++ b/content/en/altinity-kb-queries-and-syntax/projections-examples.md @@ -1,11 +1,14 @@ --- -title: "Projections" -linkTitle: "Projections" +title: "ClickHouse® Projections" +linkTitle: "ClickHouse Projections" description: > - Projections + Using this ClickHouse feature to optimize queries +keywords: + - clickhouse projections + - clickhouse projection vs materialized view --- -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. +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. 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. @@ -20,7 +23,7 @@ Projection parts are stored within the main table parts, and their merges occur * Blog video https://clickhouse.com/videos/how-to-a-clickhouse-query-using-projections -## Why is a projection not used? +## Why is a ClickHouse projection not used? A query analyzer should have a reason for using projection. @@ -74,11 +77,8 @@ Expression ((Project names + Projection)) What happens in the case of non-trivial background merges in ReplacingMergeTree, AggregatingMergeTree and similar, and OPTIMIZE table DEDUPLICATE queries? -Before version 24.8, projections became out of sync with the main data. - -Since version 24.8, it is controlled by a new table-level setting: - -[deduplicate_merge_projection_mode](https://clickhouse.com/docs/en/operations/settings/merge-tree-settings#deduplicate_merge_projection_mode) = 'throw'/'drop'/'rebuild' +* Before version 24.8, projections became out of sync with the main data. +* Since version 24.8, it is controlled by a new table-level setting:
[deduplicate_merge_projection_mode](https://clickhouse.com/docs/en/operations/settings/merge-tree-settings#deduplicate_merge_projection_mode) = `throw`/`drop`/`rebuild` 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 @@ -165,7 +165,7 @@ where create_table_query ilike '%projection%' ## Examples -### Aggregating projections +### Aggregating ClickHouse projections ```sql create table z(Browser String, Country UInt8, F Float64) @@ -224,7 +224,7 @@ Elapsed: 0.005 sec. Processed 22.43 thousand rows ### Emulation of an inverted index using orderby projection -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. +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. ```sql CREATE TABLE test_a diff --git a/content/en/altinity-kb-queries-and-syntax/ttl/modify-ttl.md b/content/en/altinity-kb-queries-and-syntax/ttl/modify-ttl.md index 7b524ca1a4..7b67c51d10 100644 --- a/content/en/altinity-kb-queries-and-syntax/ttl/modify-ttl.md +++ b/content/en/altinity-kb-queries-and-syntax/ttl/modify-ttl.md @@ -1,9 +1,12 @@ --- -title: "MODIFY (ADD) TTL" +title: "MODIFY (ADD) TTL in ClickHouse®" linkTitle: "MODIFY (ADD) TTL" weight: 100 description: >- - What happens during a MODIFY or ADD TTL query. + What happens during a MODIFY or ADD TTL query +keywords: + - clickhouse modify ttl + - clickhouse alter table ttl --- *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).* diff --git a/content/en/altinity-kb-setup-and-maintenance/altinity-kb-monitoring.md b/content/en/altinity-kb-setup-and-maintenance/altinity-kb-monitoring.md index 08ae2d18d1..039af22ea6 100644 --- a/content/en/altinity-kb-setup-and-maintenance/altinity-kb-monitoring.md +++ b/content/en/altinity-kb-setup-and-maintenance/altinity-kb-monitoring.md @@ -2,16 +2,15 @@ title: "ClickHouse® Monitoring" linkTitle: "ClickHouse® Monitoring" description: > - ClickHouse® Monitoring + Tracking potential issues in your cluster before they cause a critical error +keywords: + - clickhouse monitoring + - clickhouse metrics --- -## ClickHouse® Monitoring - -Monitoring helps to track potential issues in your cluster before they cause a critical error. - -What to read / watch on subject: -* 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) -* docs https://clickhouse.com/docs/en/operations/monitoring/ +What to read / watch on the subject: +* 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). +* [The ClickHouse docs](https://clickhouse.com/docs/en/operations/monitoring/) ## What should be monitored @@ -38,7 +37,7 @@ The following metrics should be collected / monitored * [See separate article](../altinity-kb-zookeeper/zookeeper-monitoring/) -## Monitoring tools +## ClickHouse monitoring tools ### Prometheus (embedded exporter) + Grafana @@ -99,9 +98,9 @@ The following metrics should be collected / monitored * site24x7 https://www.site24x7.com/plugins/clickhouse-monitoring.html * Acceldata Pulse https://www.acceldata.io/blog/acceldata-pulse-for-clickhouse-monitoring -### "Build your own" monitoring +### "Build your own" ClickHouse monitoring -ClickHouse allow to access lot of internals using system tables. The main tables to access monitoring data are: +ClickHouse allows to access lots of internals using system tables. The main tables to access monitoring data are: * system.metrics * system.asynchronous_metrics * system.events @@ -310,13 +309,13 @@ The following queries are recommended to be included in monitoring: * `SELECT * FROM system.mutations` * This is the source of information on the speed and progress of currently executed merges. -## Logs monitoring +## Monitoring ClickHouse logs -ClickHouse logs can be another important source of information. There are 2 logs enabled by default +[ClickHouse logs](/altinity-kb-setup-and-maintenance/logging/) can be another important source of information. There are 2 logs enabled by default * /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) * /var/log/clickhouse-server/clickhouse-server.log (trace logs, very detailed, useful for debugging, usually too verbose to monitor). -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). +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). ``` $ cat /etc/clickhouse-server/config.d/text_log.xml