Skip to content

Commit fd5be54

Browse files
committed
fix anchors
1 parent ec0a4c8 commit fd5be54

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ The second index entry (‘mark 1’) is storing the minimum and maximum URL val
861861
(ClickHouse also created a special [mark file](#mark-files-are-used-for-locating-granules) for to the data skipping index for [locating](#mark-files-are-used-for-locating-granules) the groups of granules associated with the index marks.)
862862

863863

864-
Because of the similarly high cardinality of UserID and URL, this secondary data skipping index can't help with excluding granules from being selected when our [query filtering on URL](#query-on-url) is executed.
864+
Because of the similarly high cardinality of UserID and URL, this secondary data skipping index can't help with excluding granules from being selected when our [query filtering on URL](/guides/best-practices/sparse-primary-indexes#secondary-key-columns-can-not-be-inefficient) is executed.
865865

866866
The specific URL value that the query is looking for (i.e. 'http://public_search') very likely is between the minimum and maximum value stored by the index for each group of granules resulting in ClickHouse being forced to select the group of granules (because they might contain row(s) matching the query).
867867

@@ -1009,7 +1009,7 @@ ClickHouse selected only 39 index marks, instead of 1076 when generic exclusion
10091009
Note that the additional table is optimized for speeding up the execution of our example query filtering on URLs.
10101010

10111011

1012-
Similar to the [bad performance](/guides/best-practices/sparse-primary-indexes#query-on-userid-slow) of that query with our [original table](#a-table-with-a-primary-key), our [example query filtering on `UserIDs`](#the-primary-index-is-used-for-selecting-granules) will not run very effectively with the new additional table, because UserID is now the second key column in the primary index of that table and therefore ClickHouse will use generic exclusion search for granule selection, which is [not very effective for similarly high cardinality](/guides/best-practices/sparse-primary-indexes#generic-exclusion-search-slow) of UserID and URL.
1012+
Similar to the [bad performance](/best-practices/sparse-primary-indexes#secondary-key-columns-can-not-be-inefficient) of that query with our [original table](#a-table-with-a-primary-key), our [example query filtering on `UserIDs`](#the-primary-index-is-used-for-selecting-granules) will not run very effectively with the new additional table, because UserID is now the second key column in the primary index of that table and therefore ClickHouse will use generic exclusion search for granule selection, which is [not very effective for similarly high cardinality](/guides/best-practices/sparse-primary-indexes#generic-exclusion-search-algorithm) of UserID and URL.
10131013
Open the details box for specifics.
10141014

10151015
<details>
@@ -1139,7 +1139,7 @@ Processed 335.87 thousand rows,
11391139
13.54 MB (12.91 million rows/s., 520.38 MB/s.)
11401140
```
11411141

1142-
Because effectively the implicitly created table (and its primary index) backing the materialized view is identical to the [secondary table that we created explicitly](/guides/best-practices/sparse-primary-indexes#multiple-primary-indexes-via-secondary-tables), the query is executed in the same effective way as with the explicitly created table.
1142+
Because effectively the implicitly created table (and its primary index) backing the materialized view is identical to the [secondary table that we created explicitly](/guides/best-practices/sparse-primary-indexes#using-multiple-primary-indexes), the query is executed in the same effective way as with the explicitly created table.
11431143

11441144
The corresponding trace log in the ClickHouse server log file confirms that ClickHouse is running binary search over the index marks:
11451145

@@ -1249,10 +1249,10 @@ The corresponding trace log in the ClickHouse server log file confirms that Clic
12491249
### Summary {#summary}
12501250

12511251

1252-
The primary index of our [table with compound primary key (UserID, URL)](#a-table-with-a-primary-key) was very useful for speeding up a [query filtering on UserID](#the-primary-index-is-used-for-selecting-granules). But that index is not providing significant help with speeding up a [query filtering on URL](/guides/best-practices/sparse-primary-indexes#query-on-url), despite the URL column being part of the compound primary key.
1252+
The primary index of our [table with compound primary key (UserID, URL)](#a-table-with-a-primary-key) was very useful for speeding up a [query filtering on UserID](#the-primary-index-is-used-for-selecting-granules). But that index is not providing significant help with speeding up a [query filtering on URL](/guides/best-practices/sparse-primary-indexes#secondary-key-columns-can-not-be-inefficient), despite the URL column being part of the compound primary key.
12531253

12541254
And vice versa:
1255-
The primary index of our [table with compound primary key (URL, UserID)](/guides/best-practices/sparse-primary-indexes#secondary-table) was speeding up a [query filtering on URL](#query-on-url), but didn't provide much support for a [query filtering on UserID](#the-primary-index-is-used-for-selecting-granules).
1255+
The primary index of our [table with compound primary key (URL, UserID)](/guides/best-practices/sparse-primary-indexes#option-1-secondary-tables) was speeding up a [query filtering on URL](/guides/best-practices/sparse-primary-indexes#secondary-key-columns-can-not-be-inefficient), but didn't provide much support for a [query filtering on UserID](#the-primary-index-is-used-for-selecting-granules).
12561256

12571257
Because of the similarly high cardinality of the primary key columns UserID and URL, a query that filters on the second key column [doesn’t benefit much from the second key column being in the index](#generic-exclusion-search-algorithm).
12581258

0 commit comments

Comments
 (0)