Skip to content

Commit ca27000

Browse files
authored
Merge pull request #4164 from ClickHouse/3966-update-glossary
3966 update glossary
2 parents c36750e + 8efa08d commit ca27000

35 files changed

+1120
-244
lines changed

.github/workflows/check-build.yml

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
check_type: [spellcheck, kbcheck, md-lint]
19+
check_type: [spellcheck, kbcheck, md-lint, glossary-check]
2020
steps:
2121
# Add setup steps per check here
2222
- uses: actions/checkout@v4
2323
- name: Install Aspell
2424
if: matrix.check_type == 'spellcheck'
2525
run: sudo apt-get update && sudo apt-get install -y aspell aspell-en
2626
- name: Set up Python
27-
if: matrix.check_type == 'kbcheck'
27+
if: matrix.check_type == 'kbcheck' || matrix.check_type == 'glossary-check'
2828
run: |
2929
curl -Ls https://astral.sh/uv/install.sh | sh
3030
uv clean
@@ -39,31 +39,25 @@ jobs:
3939
run: yarn add -D markdownlint-cli2
4040

4141
# Run the checks here
42-
- name: Run checks
43-
id: check_step
44-
run: |
45-
if [[ "${{ matrix.check_type }}" == "spellcheck" ]]; then
46-
yarn check-spelling
47-
exit_code=$?
48-
elif [[ "${{ matrix.check_type }}" == "kbcheck" ]]; then
49-
yarn check-kb
50-
exit_code=$?
51-
elif [[ "${{ matrix.check_type }}" == "md-lint" ]]; then
52-
yarn check-markdown
53-
exit_code=$?
54-
fi
55-
56-
if [[ $exit_code -ne 0 ]]; then
57-
echo "::error::${{ matrix.check_type }} check failed. See logs for details."
58-
exit 1
59-
fi
42+
- name: Run spellcheck
43+
if: matrix.check_type == 'spellcheck'
44+
run: yarn check-spelling
6045

61-
- name: Set check status
62-
if: steps.check_step.outcome != 'success'
63-
uses: actions/github-script@v6
64-
with:
65-
script: |
66-
core.setFailed('${{ matrix.check_type }} check failed.');
46+
- name: Run KB check
47+
if: matrix.check_type == 'kbcheck'
48+
run: yarn check-kb
49+
50+
- name: Run markdown lint
51+
if: matrix.check_type == 'md-lint'
52+
run: yarn check-markdown
53+
54+
- name: Run glossary check
55+
if: matrix.check_type == 'glossary-check'
56+
run: |
57+
echo "Extracting glossary from markdown..."
58+
python3 scripts/glossary/extract-glossary-terms.py
59+
echo "Checking glossary coverage..."
60+
python3 scripts/glossary/wrap-glossary-terms.py --check || echo "::warning::Glossary check found unwrapped terms (non-blocking)"
6761
6862
check_overall_status:
6963
needs: stylecheck
@@ -74,5 +68,4 @@ jobs:
7468
if: needs.stylecheck.result != 'success'
7569
run: |
7670
echo "::error::One or more checks of the style check failed."
77-
exit 1
78-
71+
exit 1

docs/best-practices/partitioning_keys.mdx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import partitions from '@site/static/images/bestpractices/partitions.png';
1212
import merges_with_partitions from '@site/static/images/bestpractices/merges_with_partitions.png';
1313

1414
:::note A data management technique
15-
Partitioning is primarily a data management technique and not a query optimization tool, and while it can improve performance in specific workloads, it should not be the first mechanism used to accelerate queries; the partitioning key must be chosen carefully, with a clear understanding of its implications, and only applied when it aligns with data life cycle needs or well-understood access patterns.
15+
Partitioning is primarily a data management technique and not a query optimization tool, and while it can improve performance in specific workloads, it should not be the first mechanism used to accelerate queries; the ^^partitioning key^^ must be chosen carefully, with a clear understanding of its implications, and only applied when it aligns with data life cycle needs or well-understood access patterns.
1616
:::
1717

18-
In ClickHouse, partitioning organizes data into logical segments based on a specified key. This is defined using the `PARTITION BY` clause at table creation time and is commonly used to group rows by time intervals, categories, or other business-relevant dimensions. Each unique value of the partitioning expression forms its own physical partition on disk, and ClickHouse stores data in separate parts for each of these values. Partitioning improves data management, simplifies retention policies, and can help with certain query patterns.
18+
In ClickHouse, partitioning organizes data into logical segments based on a specified key. This is defined using the `PARTITION BY` clause at table creation time and is commonly used to group rows by time intervals, categories, or other business-relevant dimensions. Each unique value of the partitioning expression forms its own physical partition on disk, and ClickHouse stores data in separate ^^parts^^ for each of these values. Partitioning improves data management, simplifies retention policies, and can help with certain query patterns.
1919

20-
For example, consider the following UK price paid dataset table with a partitioning key of `toStartOfMonth(date)`.
20+
For example, consider the following UK price paid dataset table with a ^^partitioning key^^ of `toStartOfMonth(date)`.
2121

2222
```sql
2323
CREATE TABLE uk.uk_price_paid_simple_partitioned
@@ -40,28 +40,28 @@ The ClickHouse server first splits the rows from the example insert with 4 rows
4040

4141
For a more detailed explanation of partitioning, we recommend [this guide](/partitions).
4242

43-
With partitioning enabled, ClickHouse only [merges](/merges) data parts within, but not across partitions. We sketch that for our example table from above:
43+
With partitioning enabled, ClickHouse only [merges](/merges) data ^^parts^^ within, but not across partitions. We sketch that for our example table from above:
4444

4545
<Image img={merges_with_partitions} size="md" alt="Partitions" />
4646

4747
## Applications of partitioning {#applications-of-partitioning}
4848

49-
Partitioning is a powerful tool for managing large datasets in ClickHouse, especially in observability and analytics use cases. It enables efficient data life cycle operations by allowing entire partitions, often aligned with time or business logic, to be dropped, moved, or archived in a single metadata operation. This is significantly faster and less resource-intensive than row-level delete or copy operations. Partitioning also integrates cleanly with ClickHouse features like TTL and tiered storage, making it possible to implement retention policies or hot/cold storage strategies without custom orchestration. For example, recent data can be kept on fast SSD-backed storage, while older partitions are automatically moved to cheaper object storage.
49+
Partitioning is a powerful tool for managing large datasets in ClickHouse, especially in observability and analytics use cases. It enables efficient data life cycle operations by allowing entire partitions, often aligned with time or business logic, to be dropped, moved, or archived in a single metadata operation. This is significantly faster and less resource-intensive than row-level delete or copy operations. Partitioning also integrates cleanly with ClickHouse features like ^^TTL^^ and tiered storage, making it possible to implement retention policies or hot/cold storage strategies without custom orchestration. For example, recent data can be kept on fast SSD-backed storage, while older partitions are automatically moved to cheaper object storage.
5050

5151
While partitioning can improve query performance for some workloads, it can also negatively impact response time.
5252

53-
If the partitioning key is not in the primary key and you are filtering by it, users may see an improvement in query performance with partitioning. See [here](/partitions#query-optimization) for an example.
53+
If the ^^partitioning key^^ is not in the ^^primary key^^ and you are filtering by it, users may see an improvement in query performance with partitioning. See [here](/partitions#query-optimization) for an example.
5454

55-
Conversely, if queries need to query across partitions performance may be negatively impacted due to a higher number of total parts. For this reason, users should understand their access patterns before considering partitioning a a query optimization technique.
55+
Conversely, if queries need to query across partitions performance may be negatively impacted due to a higher number of total ^^parts^^. For this reason, users should understand their access patterns before considering partitioning a a query optimization technique.
5656

5757
In summary, users should primarily think of partitioning as a data management technique. For an example of managing data, see ["Managing Data"](/observability/managing-data) from the observability use-case guide and ["What are table partitions used for?"](/partitions#data-management) from Core Concepts - Table partitions.
5858

59-
## Choose a low cardinality partitioning key {#choose-a-low-cardinality-partitioning-key}
59+
## Choose a low cardinality ^^partitioning key^^ {#choose-a-low-cardinality-partitioning-key}
6060

61-
Importantly, a higher number of parts will negatively affect query performance. ClickHouse will therefore respond to inserts with a [“too many parts”](/knowledgebase/exception-too-many-parts) error if the number of parts exceeds specified limits either in [total](/operations/settings/merge-tree-settings#max_parts_in_total) or [per partition](/operations/settings/merge-tree-settings#parts_to_throw_insert).
61+
Importantly, a higher number of ^^parts^^ will negatively affect query performance. ClickHouse will therefore respond to inserts with a [“too many parts”](/knowledgebase/exception-too-many-parts) error if the number of ^^parts^^ exceeds specified limits either in [total](/operations/settings/merge-tree-settings#max_parts_in_total) or [per partition](/operations/settings/merge-tree-settings#parts_to_throw_insert).
6262

63-
Choosing the right **cardinality** for the partitioning key is critical. A high-cardinality partitioning key - where the number of distinct partition values is large - can lead to a proliferation of data parts. Since ClickHouse does not merge parts across partitions, too many partitions will result in too many unmerged parts, eventually triggering the “Too many parts” error. [Merges are essential](/merges) for reducing storage fragmentation and optimizing query speed, but with high-cardinality partitions, that merge potential is lost.
63+
Choosing the right **cardinality** for the ^^partitioning key^^ is critical. A high-cardinality ^^partitioning key^^ - where the number of distinct partition values is large - can lead to a proliferation of data ^^parts^^. Since ClickHouse does not merge ^^parts^^ across partitions, too many partitions will result in too many unmerged ^^parts^^, eventually triggering the “Too many ^^parts^^” error. [Merges are essential](/merges) for reducing storage fragmentation and optimizing query speed, but with high-cardinality partitions, that merge potential is lost.
6464

65-
By contrast, a **low-cardinality partitioning key**—with fewer than 100 - 1,000 distinct values - is usually optimal. It enables efficient part merging, keeps metadata overhead low, and avoids excessive object creation in storage. In addition, ClickHouse automatically builds MinMax indexes on partition columns, which can significantly speed up queries that filter on those columns. For example, filtering by month when the table is partitioned by `toStartOfMonth(date)` allows the engine to skip irrelevant partitions and their parts entirely.
65+
By contrast, a **low-cardinality ^^partitioning key^^**—with fewer than 100 - 1,000 distinct values - is usually optimal. It enables efficient part merging, keeps metadata overhead low, and avoids excessive object creation in storage. In addition, ClickHouse automatically builds MinMax indexes on partition columns, which can significantly speed up queries that filter on those columns. For example, filtering by month when the table is partitioned by `toStartOfMonth(date)` allows the engine to skip irrelevant partitions and their ^^parts^^ entirely.
6666

67-
While partitioning can improve performance in some query patterns, it's primarily a data management feature. In many cases, querying across all partitions can be slower than using a non-partitioned table due to increased data fragmentation and more parts being scanned. Use partitioning judiciously, and always ensure that the chosen key is low-cardinality and aligns with your data life cycle policies (e.g., retention via TTL). If you're unsure whether partitioning is necessary, you may want to start without it and optimize later based on observed access patterns.
67+
While partitioning can improve performance in some query patterns, it's primarily a data management feature. In many cases, querying across all partitions can be slower than using a non-partitioned table due to increased data fragmentation and more ^^parts^^ being scanned. Use partitioning judiciously, and always ensure that the chosen key is low-cardinality and aligns with your data life cycle policies (e.g., retention via ^^TTL^^). If you're unsure whether partitioning is necessary, you may want to start without it and optimize later based on observed access patterns.

0 commit comments

Comments
 (0)