mirror of
https://github.com/hanzoai/datastore.git
synced 2026-09-26 13:55:07 +00:00
Test exercises the case from #55653 where the index expression type (UInt64 from `mortonDecode`) differs from the query condition type (UInt16 alias), causing a CAST in the monotonic function chain that is evaluated per-granule. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
29 lines
1.2 KiB
XML
29 lines
1.2 KiB
XML
<test>
|
|
<!-- Performance test for minmax skip index evaluation with type casts.
|
|
When the index expression type differs from the query condition type
|
|
(e.g., UInt64 index vs UInt16 alias), a CAST ends up in the monotonic
|
|
function chain. This test verifies that the per-granule evaluation
|
|
of such conditions is efficient.
|
|
See https://github.com/ClickHouse/ClickHouse/issues/55653 -->
|
|
|
|
<create_query>
|
|
CREATE TABLE index_test_cast
|
|
(
|
|
z UInt32,
|
|
x UInt16 ALIAS mortonDecode(2, z).1,
|
|
y UInt16 ALIAS mortonDecode(2, z).2,
|
|
INDEX i_x (mortonDecode(2, z).1) TYPE minmax,
|
|
INDEX i_y (mortonDecode(2, z).2) TYPE minmax
|
|
) ENGINE = MergeTree ORDER BY z
|
|
</create_query>
|
|
|
|
<fill_query>INSERT INTO index_test_cast SELECT number * 5 FROM numbers_mt(toUInt64(0x100000000 / 5)) SETTINGS max_insert_threads=8</fill_query>
|
|
<fill_query>OPTIMIZE TABLE index_test_cast FINAL</fill_query>
|
|
|
|
<query><![CDATA[
|
|
SELECT count() FROM index_test_cast WHERE x >= 20000 AND x <= 20100 AND y >= 10000 AND y <= 10100
|
|
]]></query>
|
|
|
|
<drop_query>DROP TABLE IF EXISTS index_test_cast</drop_query>
|
|
</test>
|