ClickHouse Guesses Join Sizes from Distinct-Value Counts: One Over the Larger NDV
ClickHouse’s join cost model is built from NDV counts, min/max ranges and row estimates.
All posts published on this site.
Everything published here, newest first.
ClickHouse’s join cost model is built from NDV counts, min/max ranges and row estimates.
ClickHouse ships three DP join-order searches over a relation-set memo, with a plan budget and a fallback chain.
ClickHouse’s CompactArray stores sub-byte values in a bitset and reads them through an unaligned 16-bit window, so a HyperLogLog rank costs 5 or 6 bits per bucket.
ClickHouse’s ArenaWithFreeLists keeps one free list per power-of-two size class and threads the free-list link through the freed block itself.
ClickHouse’s LRU cache is a hash map of cells pointing into a linked list, so a lookup is an O(1) splice and eviction is a pop from the front.