mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-01 03:52:15 +00:00
f46c5a47c0
By default uniqCombined() uses 32-bit hash for all types except String, so this means that you cannot use uniqCombined() with i.e UInt64 and cardinality > UINT_MAX, although you can use uniqCombined(toString()) and this will lead to 64-bit hash, but will not have good performance. So uniqCombined64() had been introduced to fix this. Requires: #7213
10 lines
418 B
SQL
10 lines
418 B
SQL
-- for small cardinality the 64 bit hash perform worse, but for 1e10:
|
|
-- 4 byte hash: 2.8832809652e10
|
|
-- 8 byte hash: 0.9998568925e10
|
|
-- but hence checking with 1e10 values takes too much time (~45 secs), this
|
|
-- test is just to ensure that the result is different (and to document the
|
|
-- outcome).
|
|
|
|
SELECT uniqCombined(number) FROM numbers(toUInt64(1e7));
|
|
SELECT uniqCombined64(number) FROM numbers(toUInt64(1e7));
|