Skip to content

Commit 2dc0c05

Browse files
committed
Merge branch 'image_component' of https://github.com/ClickHouse/clickhouse-docs into image_component
2 parents 4135a7d + bb034ea commit 2dc0c05

File tree

22 files changed

+1194
-75
lines changed

22 files changed

+1194
-75
lines changed

contribute/style-guide.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,38 @@ Code blocks:
9292
- Have a title (optional) such as 'Query' or 'Response'
9393
- Use language `response` if it is for the result of a query.
9494

95+
### Highlighting
96+
97+
You can highlight lines in a code block using the following keywords:
98+
99+
- `highlight-next-line`
100+
- `highlight-start`
101+
- `highlight-end`
102+
103+
These keywords should be added as comments in the codeblock with the appropriate
104+
escape symbol for the codeblock language.
105+
106+
For example, if the codeblock is SQL:
107+
108+
```text
109+
SELECT UserID, count(UserID) AS Count
110+
-- highlight-next-line
111+
FROM mv_hits_URL_UserID
112+
WHERE URL = 'http://public_search'
113+
GROUP BY UserID
114+
ORDER BY Count DESC
115+
LIMIT 10;
116+
```
117+
118+
If the codeblock is a response:
119+
120+
```text
121+
10 rows in set. Elapsed: 0.026 sec.
122+
# highlight-next-line
123+
Processed 335.87 thousand rows,
124+
13.54 MB (12.91 million rows/s., 520.38 MB/s.)
125+
```
126+
95127
### Associated markdown rule or CI check
96128

97129
- [`MD040` enforces that codeblocks have a language specified](/scripts/.markdownlint-cli2.yaml)

docs/cloud/bestpractices/avoidnullablecolumns.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ To avoid `Nullable` columns, consider setting a default value for that column.
1313
CREATE TABLE default.sample
1414
(
1515
`x` Int8,
16-
# highlight-next-line
16+
-- highlight-next-line
1717
`y` Nullable(Int8)
1818
)
1919
ENGINE = MergeTree
@@ -25,7 +25,7 @@ use
2525
CREATE TABLE default.sample2
2626
(
2727
`x` Int8,
28-
# highlight-next-line
28+
-- highlight-next-line
2929
`y` Int8 DEFAULT 0
3030
)
3131
ENGINE = MergeTree

docs/data-modeling/backfilling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,14 +465,14 @@ Notice our memory usage here is `639.47 MiB`.
465465

466466
##### Tuning performance & resources {#tuning-performance--resources}
467467

468-
Several factors will determine the performance and resources used in the above scenario. We recommend readers understand insert mechanics documented in detail [here](/integrations/s3/performance#using-threads-for-reads) prior to attempting to tune. In summary:
468+
Several factors will determine the performance and resources used in the above scenario. Before attempting to tune, we recommend readers understand the insert mechanics documented in detail in the [Using Threads for Reads](/integrations/s3/performance#using-threads-for-reads) section of the [Optimizing for S3 Insert and Read Performance guide](/integrations/s3/performance). In summary:
469469

470470
- **Read Parallelism** - The number of threads used to read. Controlled through [`max_threads`](/operations/settings/settings#max_threads). In ClickHouse Cloud this is determined by the instance size with it defaulting to the number of vCPUs. Increasing this value may improve read performance at the expense of greater memory usage.
471471
- **Insert Parallelism** - The number of insert threads used to insert. Controlled through [`max_insert_threads`](/operations/settings/settings#max_insert_threads). In ClickHouse Cloud this is determined by the instance size (between 2 and 4) and is set to 1 in OSS. Increasing this value may improve performance at the expense of greater memory usage.
472472
- **Insert Block Size** - data is processed in a loop where it is pulled, parsed, and formed into in-memory insert blocks based on the [partitioning key](/engines/table-engines/mergetree-family/custom-partitioning-key). These blocks are sorted, optimized, compressed, and written to storage as new [data parts](/parts). The size of the insert block, controlled by settings [`min_insert_block_size_rows`](/operations/settings/settings#min_insert_block_size_rows) and [`min_insert_block_size_bytes`](/operations/settings/settings#min_insert_block_size_bytes) (uncompressed), impacts memory usage and disk I/O. Larger blocks use more memory but create fewer parts, reducing I/O and background merges. These settings represent minimum thresholds (whichever is reached first triggers a flush).
473473
- **Materialized view block size** - As well as the above mechanics for the main insert, prior to insertion into materialized views, blocks are also squashed for more efficient processing. The size of these blocks is determined by the settings [`min_insert_block_size_bytes_for_materialized_views`](/operations/settings/settings#min_insert_block_size_bytes_for_materialized_views) and [`min_insert_block_size_rows_for_materialized_views`](/operations/settings/settings#min_insert_block_size_rows_for_materialized_views). Larger blocks allow more efficient processing at the expense of greater memory usage. By default, these settings revert to the values of the source table settings [`min_insert_block_size_rows`](/operations/settings/settings#min_insert_block_size_rows) and [`min_insert_block_size_bytes`](/operations/settings/settings#min_insert_block_size_bytes), respectively.
474474

475-
For improving performance, users can follow the guidelines outlined [here](/integrations/s3/performance#tuning-threads-and-block-size-for-inserts). It should not be necessary to also modify `min_insert_block_size_bytes_for_materialized_views` and `min_insert_block_size_rows_for_materialized_views` to improve performance in most cases. If these are modified, use the same best practices as discussed for `min_insert_block_size_rows` and `min_insert_block_size_bytes`.
475+
For improving performance, users can follow the guidelines outlined in the [Tuning Threads and Block Size for Inserts](/integrations/s3/performance#tuning-threads-and-block-size-for-inserts) section of the [Optimizing for S3 Insert and Read Performance guide](/integrations/s3/performance). It should not be necessary to also modify `min_insert_block_size_bytes_for_materialized_views` and `min_insert_block_size_rows_for_materialized_views` to improve performance in most cases. If these are modified, use the same best practices as discussed for `min_insert_block_size_rows` and `min_insert_block_size_bytes`.
476476

477477
To minimize memory, users may wish to experiment with these settings. This will invariably lower performance. Using the earlier query, we show examples below.
478478

docs/guides/best-practices/sparse-primary-indexes.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ The response is:
147147
└────────────────────────────────┴───────┘
148148
149149
10 rows in set. Elapsed: 0.022 sec.
150-
// highlight-next-line
150+
# highlight-next-line
151151
Processed 8.87 million rows,
152152
70.45 MB (398.53 million rows/s., 3.17 GB/s.)
153153
```
@@ -184,7 +184,7 @@ CREATE TABLE hits_UserID_URL
184184
`EventTime` DateTime
185185
)
186186
ENGINE = MergeTree
187-
// highlight-next-line
187+
-- highlight-next-line
188188
PRIMARY KEY (UserID, URL)
189189
ORDER BY (UserID, URL, EventTime)
190190
SETTINGS index_granularity = 8192, index_granularity_bytes = 0, compress_primary_key = 0;
@@ -519,7 +519,7 @@ The response is:
519519
└────────────────────────────────┴───────┘
520520
521521
10 rows in set. Elapsed: 0.005 sec.
522-
// highlight-next-line
522+
# highlight-next-line
523523
Processed 8.19 thousand rows,
524524
740.18 KB (1.53 million rows/s., 138.59 MB/s.)
525525
```
@@ -530,13 +530,13 @@ The output for the ClickHouse client is now showing that instead of doing a full
530530
If <a href="https://clickhouse.com/docs/operations/server-configuration-parameters/settings/#server_configuration_parameters-logger" target="_blank">trace logging</a> is enabled then the ClickHouse server log file shows that ClickHouse was running a <a href="https://github.com/ClickHouse/ClickHouse/blob/22.3/src/Storages/MergeTree/MergeTreeDataSelectExecutor.cpp#L1452" target="_blank">binary search</a> over the 1083 UserID index marks, in order to identify granules that possibly can contain rows with a UserID column value of `749927693`. This requires 19 steps with an average time complexity of `O(log2 n)`:
531531
```response
532532
...Executor): Key condition: (column 0 in [749927693, 749927693])
533-
// highlight-next-line
533+
# highlight-next-line
534534
...Executor): Running binary search on index range for part all_1_9_2 (1083 marks)
535535
...Executor): Found (LEFT) boundary mark: 176
536536
...Executor): Found (RIGHT) boundary mark: 177
537537
...Executor): Found continuous range in 19 steps
538538
...Executor): Selected 1/1 parts by partition key, 1 parts by primary key,
539-
// highlight-next-line
539+
# highlight-next-line
540540
1/1083 marks by primary key, 1 marks to read from 1 ranges
541541
...Reading ...approx. 8192 rows starting from 1441792
542542
```
@@ -584,7 +584,7 @@ The response looks like:
584584
│ UserID │
585585
│ Condition: (UserID in [749927693, 749927693]) │
586586
│ Parts: 1/1 │
587-
// highlight-next-line
587+
# highlight-next-line
588588
│ Granules: 1/1083 │
589589
└───────────────────────────────────────────────────────────────────────────────────────┘
590590
@@ -753,7 +753,7 @@ The response is: <a name="query-on-url-slow"></a>
753753
└────────────┴───────┘
754754
755755
10 rows in set. Elapsed: 0.086 sec.
756-
// highlight-next-line
756+
# highlight-next-line
757757
Processed 8.81 million rows,
758758
799.69 MB (102.11 million rows/s., 9.27 GB/s.)
759759
```
@@ -764,11 +764,11 @@ If [trace_logging](/operations/server-configuration-parameters/settings#logger)
764764
```response
765765
...Executor): Key condition: (column 1 in ['http://public_search',
766766
'http://public_search'])
767-
// highlight-next-line
767+
# highlight-next-line
768768
...Executor): Used generic exclusion search over index for part all_1_9_2
769769
with 1537 steps
770770
...Executor): Selected 1/1 parts by partition key, 1 parts by primary key,
771-
// highlight-next-line
771+
# highlight-next-line
772772
1076/1083 marks by primary key, 1076 marks to read from 5 ranges
773773
...Executor): Reading approx. 8814592 rows with 10 streams
774774
```
@@ -917,7 +917,7 @@ CREATE TABLE hits_URL_UserID
917917
`EventTime` DateTime
918918
)
919919
ENGINE = MergeTree
920-
// highlight-next-line
920+
-- highlight-next-line
921921
PRIMARY KEY (URL, UserID)
922922
ORDER BY (URL, UserID, EventTime)
923923
SETTINGS index_granularity = 8192, index_granularity_bytes = 0, compress_primary_key = 0;
@@ -954,7 +954,7 @@ This is the resulting primary key:
954954
That can now be used to significantly speed up the execution of our example query filtering on the URL column in order to calculate the top 10 users that most frequently clicked on the URL "http://public_search":
955955
```sql
956956
SELECT UserID, count(UserID) AS Count
957-
// highlight-next-line
957+
-- highlight-next-line
958958
FROM hits_URL_UserID
959959
WHERE URL = 'http://public_search'
960960
GROUP BY UserID
@@ -980,7 +980,7 @@ The response is:
980980
└────────────┴───────┘
981981
982982
10 rows in set. Elapsed: 0.017 sec.
983-
// highlight-next-line
983+
# highlight-next-line
984984
Processed 319.49 thousand rows,
985985
11.38 MB (18.41 million rows/s., 655.75 MB/s.)
986986
```
@@ -994,13 +994,13 @@ The corresponding trace log in the ClickHouse server log file confirms that:
994994
```response
995995
...Executor): Key condition: (column 0 in ['http://public_search',
996996
'http://public_search'])
997-
// highlight-next-line
997+
# highlight-next-line
998998
...Executor): Running binary search on index range for part all_1_9_2 (1083 marks)
999999
...Executor): Found (LEFT) boundary mark: 644
10001000
...Executor): Found (RIGHT) boundary mark: 683
10011001
...Executor): Found continuous range in 19 steps
10021002
...Executor): Selected 1/1 parts by partition key, 1 parts by primary key,
1003-
// highlight-next-line
1003+
# highlight-next-line
10041004
39/1083 marks by primary key, 39 marks to read from 1 ranges
10051005
...Executor): Reading approx. 319488 rows with 2 streams
10061006
```
@@ -1045,19 +1045,19 @@ The response is:
10451045
└────────────────────────────────┴───────┘
10461046
10471047
10 rows in set. Elapsed: 0.024 sec.
1048-
// highlight-next-line
1048+
# highlight-next-line
10491049
Processed 8.02 million rows,
10501050
73.04 MB (340.26 million rows/s., 3.10 GB/s.)
10511051
```
10521052

10531053
Server Log:
10541054
```response
10551055
...Executor): Key condition: (column 1 in [749927693, 749927693])
1056-
// highlight-next-line
1056+
# highlight-next-line
10571057
...Executor): Used generic exclusion search over index for part all_1_9_2
10581058
with 1453 steps
10591059
...Executor): Selected 1/1 parts by partition key, 1 parts by primary key,
1060-
// highlight-next-line
1060+
# highlight-next-line
10611061
980/1083 marks by primary key, 980 marks to read from 23 ranges
10621062
...Executor): Reading approx. 8028160 rows with 10 streams
10631063
```
@@ -1108,7 +1108,7 @@ ClickHouse is storing the [column data files](#data-is-stored-on-disk-ordered-by
11081108
The implicitly created table (and its primary index) backing the materialized view can now be used to significantly speed up the execution of our example query filtering on the URL column:
11091109
```sql
11101110
SELECT UserID, count(UserID) AS Count
1111-
// highlight-next-line
1111+
-- highlight-next-line
11121112
FROM mv_hits_URL_UserID
11131113
WHERE URL = 'http://public_search'
11141114
GROUP BY UserID
@@ -1133,7 +1133,7 @@ The response is:
11331133
└────────────┴───────┘
11341134
11351135
10 rows in set. Elapsed: 0.026 sec.
1136-
// highlight-next-line
1136+
# highlight-next-line
11371137
Processed 335.87 thousand rows,
11381138
13.54 MB (12.91 million rows/s., 520.38 MB/s.)
11391139
```
@@ -1145,11 +1145,11 @@ The corresponding trace log in the ClickHouse server log file confirms that Clic
11451145
```response
11461146
...Executor): Key condition: (column 0 in ['http://public_search',
11471147
'http://public_search'])
1148-
// highlight-next-line
1148+
# highlight-next-line
11491149
...Executor): Running binary search on index range ...
11501150
...
11511151
...Executor): Selected 4/4 parts by partition key, 4 parts by primary key,
1152-
// highlight-next-line
1152+
# highlight-next-line
11531153
41/1083 marks by primary key, 41 marks to read from 4 ranges
11541154
...Executor): Reading approx. 335872 rows with 4 streams
11551155
```
@@ -1193,7 +1193,7 @@ ClickHouse is storing the [column data files](#data-is-stored-on-disk-ordered-by
11931193
The hidden table (and its primary index) created by the projection can now be (implicitly) used to significantly speed up the execution of our example query filtering on the URL column. Note that the query is syntactically targeting the source table of the projection.
11941194
```sql
11951195
SELECT UserID, count(UserID) AS Count
1196-
// highlight-next-line
1196+
-- highlight-next-line
11971197
FROM hits_UserID_URL
11981198
WHERE URL = 'http://public_search'
11991199
GROUP BY UserID
@@ -1218,7 +1218,7 @@ The response is:
12181218
└────────────┴───────┘
12191219
12201220
10 rows in set. Elapsed: 0.029 sec.
1221-
// highlight-next-line
1221+
# highlight-next-line
12221222
Processed 319.49 thousand rows, 1
12231223
1.38 MB (11.05 million rows/s., 393.58 MB/s.)
12241224
```
@@ -1231,14 +1231,14 @@ The corresponding trace log in the ClickHouse server log file confirms that Clic
12311231
```response
12321232
...Executor): Key condition: (column 0 in ['http://public_search',
12331233
'http://public_search'])
1234-
// highlight-next-line
1234+
# highlight-next-line
12351235
...Executor): Running binary search on index range for part prj_url_userid (1083 marks)
12361236
...Executor): ...
1237-
// highlight-next-line
1237+
# highlight-next-line
12381238
...Executor): Choose complete Normal projection prj_url_userid
12391239
...Executor): projection required columns: URL, UserID
12401240
...Executor): Selected 1/1 parts by partition key, 1 parts by primary key,
1241-
// highlight-next-line
1241+
# highlight-next-line
12421242
39/1083 marks by primary key, 39 marks to read from 1 ranges
12431243
...Executor): Reading approx. 319488 rows with 2 streams
12441244
```
@@ -1317,7 +1317,7 @@ CREATE TABLE hits_URL_UserID_IsRobot
13171317
`IsRobot` UInt8
13181318
)
13191319
ENGINE = MergeTree
1320-
// highlight-next-line
1320+
-- highlight-next-line
13211321
PRIMARY KEY (URL, UserID, IsRobot);
13221322
```
13231323

@@ -1345,7 +1345,7 @@ CREATE TABLE hits_IsRobot_UserID_URL
13451345
`IsRobot` UInt8
13461346
)
13471347
ENGINE = MergeTree
1348-
// highlight-next-line
1348+
-- highlight-next-line
13491349
PRIMARY KEY (IsRobot, UserID, URL);
13501350
```
13511351
And populate it with the same 8.87 million rows that we used to populate the previous table:
@@ -1385,7 +1385,7 @@ The response is:
13851385
└─────────┘
13861386
13871387
1 row in set. Elapsed: 0.026 sec.
1388-
// highlight-next-line
1388+
# highlight-next-line
13891389
Processed 7.92 million rows,
13901390
31.67 MB (306.90 million rows/s., 1.23 GB/s.)
13911391
```
@@ -1403,7 +1403,7 @@ The response is:
14031403
└─────────┘
14041404
14051405
1 row in set. Elapsed: 0.003 sec.
1406-
// highlight-next-line
1406+
# highlight-next-line
14071407
Processed 20.32 thousand rows,
14081408
81.28 KB (6.61 million rows/s., 26.44 MB/s.)
14091409
```

docs/guides/sre/user-management/ssl-user-auth.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ import SelfManaged from '@site/docs/_snippets/_self_managed_only_no_roadmap.md';
1414
This guide provides simple and minimal settings to configure authentication with SSL user certificates. The tutorial builds on the [Configuring SSL-TLS user guide](../configuring-ssl.md).
1515

1616
:::note
17-
SSL user authentication is supported when using the `https` or native interfaces only.
18-
It is not currently used in gRPC or PostgreSQL/MySQL emulation ports.
17+
SSL user authentication is supported when using the `https`, `native`, `mysql`, and `postgresql` interfaces.
1918

2019
ClickHouse nodes need `<verificationMode>strict</verificationMode>` set for secure authentication (although `relaxed` will work for testing purposes).
20+
21+
If you use AWS NLB with the MySQL interface, you have to ask AWS support to enable the undocumented option:
22+
23+
> I would like to be able to configure our NLB proxy protocol v2 as below `proxy_protocol_v2.client_to_server.header_placement,Value=on_first_ack`.
2124
:::
2225

2326
## 1. Create SSL user certificates {#1-create-ssl-user-certificates}

docs/integrations/data-ingestion/gcs/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ CREATE TABLE trips_gcs
156156
ENGINE = MergeTree
157157
PARTITION BY toYYYYMM(pickup_date)
158158
ORDER BY pickup_datetime
159-
# highlight-next-line
159+
-- highlight-next-line
160160
SETTINGS storage_policy='gcs_main'
161161
```
162162

@@ -469,10 +469,10 @@ zk_synced_followers 2
469469
# highlight-end
470470
```
471471

472-
473472
### Start ClickHouse server {#start-clickhouse-server}
474473

475474
On `chnode1` and `chnode` run:
475+
476476
```bash
477477
sudo service clickhouse-server start
478478
```
@@ -547,7 +547,7 @@ cache_path:
547547
```
548548
#### Verify that tables created on the cluster are created on both nodes {#verify-that-tables-created-on-the-cluster-are-created-on-both-nodes}
549549
```sql
550-
# highlight-next-line
550+
-- highlight-next-line
551551
create table trips on cluster 'cluster_1S_2R' (
552552
`trip_id` UInt32,
553553
`pickup_date` Date,
@@ -565,7 +565,7 @@ create table trips on cluster 'cluster_1S_2R' (
565565
ENGINE = ReplicatedMergeTree
566566
PARTITION BY toYYYYMM(pickup_date)
567567
ORDER BY pickup_datetime
568-
# highlight-next-line
568+
-- highlight-next-line
569569
SETTINGS storage_policy='gcs_main'
570570
```
571571
```response

0 commit comments

Comments
 (0)