Files
Yue Ni ba6cb2a5a7 Optimize bitmapContains range checks
Avoid calling `rb_max` from `rb_contains` for non-`UInt64` bitmaps. Check the queried value against the representable range for the current storage instead.

Add a stateless correctness test and a performance test for `bitmapContains` on `UInt32` bitmaps.

Issue: https://github.com/ClickHouse/ClickHouse/issues/65639
2026-05-27 23:42:11 +08:00

38 lines
909 B
XML

<test>
<settings>
<max_threads>1</max_threads>
</settings>
<create_query>
CREATE TABLE bitmap_contains_32
(
bm AggregateFunction(groupBitmap, UInt32)
)
ENGINE = Memory
</create_query>
<fill_query>
INSERT INTO bitmap_contains_32
SELECT groupBitmapState(toUInt32(number))
FROM numbers(1000000)
</fill_query>
<query>
WITH (SELECT bm FROM bitmap_contains_32) AS bm
SELECT countIf(bitmapContains(bm, toUInt64(number % 1000000)))
FROM numbers(10000000)
FORMAT Null
</query>
<query>
WITH (SELECT bm FROM bitmap_contains_32) AS bm
SELECT countIf(bitmapContains(bm, toUInt64(4294967296 + number % 1000000)))
FROM numbers(10000000)
FORMAT Null
</query>
<drop_query>
DROP TABLE bitmap_contains_32
</drop_query>
</test>