clickhouse-docs icon indicating copy to clipboard operation
clickhouse-docs copied to clipboard

Better description of n-gram bloom filter index tuning

Open rschu1ze opened this issue 11 months ago • 1 comments

ClickHouse provides different skip / secondary indexes types, for example "N-gram Bloom Filter" indexes. These are documented here:

https://clickhouse.com/docs/en/engines/table-engines/mergetree-family/mergetree#table_engine-mergetree-data_skipping-indexes

Indexes of this type are highly sensitive to the choice of the index parameters (n, size_of_bloom_filter_in_bytes, number_of_hash_functions). If these constants are off, the index becomes ineffective.

I was helping a customer today tuning their n-gram filter indexes and I found that the documentation of the tuning-process is not "idiot-proof" enough. The current docs mention different UDFs to help calculate the parameters, but then they also mention 4300 as the number of ngrams per granule without explaining how this number can be calculated. (I found this comment in GitHub which helped me with that but it is really not obvious).

Can we please rewrite the entire tuning process in a more user-friendly manner?

EDIT: I would say we can remove the UDFs. Normal formulas would be just fine.

rschu1ze avatar Jan 10 '25 12:01 rschu1ze

We have internal resources for this.

gingerwizard avatar Jan 29 '25 11:01 gingerwizard