Update test.

This commit is contained in:
Nikolai Kochetov 2021-04-16 20:19:03 +03:00
parent d5882620b2
commit abe84acc8c
2 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@
Keys: Keys:
y y
bitAnd(z, 3) bitAnd(z, 3)
Condition: and((bitAnd(z, 3) not in [1, 1]), (y in [1, +inf))) Condition: and((bitAnd(z, 3) not in [1, 1]), and((y in [1, +inf)), (bitAnd(z, 3) not in [1, 1])))
Parts: 3/4 Parts: 3/4
Granules: 10/11 Granules: 10/11
PrimaryKey PrimaryKey

View File

@ -7,7 +7,7 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
$CLICKHOUSE_CLIENT -q "drop table if exists test_index" $CLICKHOUSE_CLIENT -q "drop table if exists test_index"
$CLICKHOUSE_CLIENT -q "drop table if exists idx" $CLICKHOUSE_CLIENT -q "drop table if exists idx"
$CLICKHOUSE_CLIENT -q "create table test_index (x UInt32, y UInt32, z UInt32, t UInt32, index t_minmax t % 20 TYPE minmax GRANULARITY 2, index t_set t % 19 type set(4) granularity 2) engine = MergeTree order by (x, y) partition by (y, bitAnd(z, 3), intDiv(t, 15)) settings index_granularity = 2" $CLICKHOUSE_CLIENT -q "create table test_index (x UInt32, y UInt32, z UInt32, t UInt32, index t_minmax t % 20 TYPE minmax GRANULARITY 2, index t_set t % 19 type set(4) granularity 2) engine = MergeTree order by (x, y) partition by (y, bitAnd(z, 3), intDiv(t, 15)) settings index_granularity = 2, min_bytes_for_wide_part = 0"
$CLICKHOUSE_CLIENT -q "insert into test_index select number, number > 3 ? 3 : number, number = 1 ? 1 : 0, number from numbers(20)" $CLICKHOUSE_CLIENT -q "insert into test_index select number, number > 3 ? 3 : number, number = 1 ? 1 : 0, number from numbers(20)"
$CLICKHOUSE_CLIENT -q " $CLICKHOUSE_CLIENT -q "
@ -26,7 +26,7 @@ $CLICKHOUSE_CLIENT -q "
explain actions = 1 select x from test_index where x > 15 order by x desc; explain actions = 1 select x from test_index where x > 15 order by x desc;
" | grep -A 100 "ReadFromMergeTree" " | grep -A 100 "ReadFromMergeTree"
$CLICKHOUSE_CLIENT -q "CREATE TABLE idx (x UInt32, y UInt32, z UInt32) ENGINE = MergeTree ORDER BY (x, x + y)" $CLICKHOUSE_CLIENT -q "CREATE TABLE idx (x UInt32, y UInt32, z UInt32) ENGINE = MergeTree ORDER BY (x, x + y) settings min_bytes_for_wide_part = 0"
$CLICKHOUSE_CLIENT -q "insert into idx select number, number, number from numbers(10)" $CLICKHOUSE_CLIENT -q "insert into idx select number, number, number from numbers(10)"
$CLICKHOUSE_CLIENT -q " $CLICKHOUSE_CLIENT -q "