Merge remote-tracking branch 'origin/master' into update-cross-compile-doc

This commit is contained in:
yokofly 2023-11-02 03:56:06 -07:00
commit dfb0172aa5
5 changed files with 127 additions and 47 deletions

View File

@ -45,4 +45,4 @@ We are a globally diverse and distributed team, united behind a common goal of c
Check out our **current openings** here: https://clickhouse.com/company/careers
Cant find what you are looking for, but want to let us know you are interested in joining ClickHouse? Email careers@clickhouse.com!
Can't find what you are looking for, but want to let us know you are interested in joining ClickHouse? Email careers@clickhouse.com!

View File

@ -2,31 +2,20 @@
00593_union_all_assert_columns_removed
00717_merge_and_distributed
00725_memory_tracking
00754_distributed_optimize_skip_select_on_unused_shards
00754_distributed_optimize_skip_select_on_unused_shards_with_prewhere
00940_order_by_read_in_order_query_plan
01062_pm_all_join_with_block_continuation
01064_incremental_streaming_from_2_src_with_feedback
01071_force_optimize_skip_unused_shards
01072_optimize_skip_unused_shards_const_expr_eval
01083_expressions_in_engine_arguments
01155_rename_move_materialized_view
01173_transaction_control_queries
01213_optimize_skip_unused_shards_DISTINCT
01214_test_storage_merge_aliases_with_where
01244_optimize_distributed_group_by_sharding_key
01247_optimize_distributed_group_by_sharding_key_dist_on_dist
01268_mv_scalars
01268_shard_avgweighted
01270_optimize_skip_unused_shards_low_cardinality
01319_optimize_skip_unused_shards_nesting
01455_shard_leaf_max_rows_bytes_to_read
01495_subqueries_in_with_statement
01504_rocksdb
01527_dist_sharding_key_dictGet_reload
01528_allow_nondeterministic_optimize_skip_unused_shards
01560_merge_distributed_join
01563_distributed_query_finish
01584_distributed_buffer_cannot_find_column
01586_columns_pruning
01624_soft_constraints
@ -35,16 +24,10 @@
01739_index_hint
02880_indexHint__partition_id
01747_join_view_filter_dictionary
01756_optimize_skip_unused_shards_rewrite_in
01757_optimize_skip_unused_shards_limit
01758_optimize_skip_unused_shards_once
01759_optimize_skip_unused_shards_zero_shards
01761_cast_to_enum_nullable
01786_explain_merge_tree
01901_in_literal_shard_prune
01925_join_materialized_columns
01925_test_storage_merge_aliases
01930_optimize_skip_unused_shards_rewrite_in
01947_mv_subquery
01952_optimize_distributed_group_by_sharding_key
02131_used_row_policies_in_query_log

View File

@ -69,7 +69,7 @@ WHERE greaterOrEquals(event_date, ignore(ignore(ignore(NULL, '')), 256), yesterd
WHERE current_database = currentDatabase() AND (event_date >= yesterday()) AND (query LIKE '%test memory profiler%')
ORDER BY event_time DESC
LIMIT 1
)); -- { serverError 125 }
)); -- { serverError 125, 42 }
DROP TABLE IF EXISTS trace_log;
@ -111,5 +111,5 @@ WITH (
) AS t)
SELECT if(dateDiff('second', toDateTime(time_with_microseconds), toDateTime(t)) = -9223372036854775808, 'ok', '');
set joined_subquery_requires_alias=0;
set joined_subquery_requires_alias=0, allow_experimental_analyzer=0; -- the query is invalid with a new analyzer
SELECT number, number / 2 AS n, j1, j2 FROM remote('127.0.0.{2,3}', system.numbers) GLOBAL ANY LEFT JOIN (SELECT number / 3 AS n, number AS j1, 'Hello' AS j2 FROM system.numbers LIMIT 1048577) USING (n) LIMIT 10 format Null;

View File

@ -85,6 +85,100 @@
}
}
]
-----------------
ReadFromMergeTree (default.test_index)
ReadType: InOrder
Parts: 1
Granules: 3
-----------------
ReadFromMergeTree (default.test_index)
ReadType: InReverseOrder
Parts: 1
Granules: 3
ReadFromMergeTree (default.idx)
Indexes:
PrimaryKey
Keys:
x
plus(x, y)
Condition: or((x in 2-element set), (plus(plus(x, y), 1) in (-Inf, 2]))
Parts: 1/1
Granules: 1/1
ReadFromMergeTree (default.test_index)
Indexes:
MinMax
Keys:
y
Condition: (y in [1, +Inf))
Parts: 4/5
Granules: 11/12
Partition
Keys:
y
bitAnd(z, 3)
Condition: and((y in [1, +Inf)), (bitAnd(z, 3) not in [1, 1]))
Parts: 3/4
Granules: 10/11
PrimaryKey
Keys:
x
y
Condition: and((x in [11, +Inf)), (y in [1, +Inf)))
Parts: 2/3
Granules: 6/10
Skip
Name: t_minmax
Description: minmax GRANULARITY 2
Parts: 1/2
Granules: 3/6
-----------------
"Node Type": "ReadFromMergeTree",
"Description": "default.test_index",
"Indexes": [
{
"Type": "MinMax",
"Keys": ["y"],
"Condition": "(y in [1, +Inf))",
"Initial Parts": 5,
"Selected Parts": 4,
"Initial Granules": 12,
"Selected Granules": 11
},
{
"Type": "Partition",
"Keys": ["y", "bitAnd(z, 3)"],
"Condition": "and((y in [1, +Inf)), (bitAnd(z, 3) not in [1, 1]))",
"Initial Parts": 4,
"Selected Parts": 3,
"Initial Granules": 11,
"Selected Granules": 10
},
{
"Type": "PrimaryKey",
"Keys": ["x", "y"],
"Condition": "and((x in [11, +Inf)), (y in [1, +Inf)))",
"Initial Parts": 3,
"Selected Parts": 2,
"Initial Granules": 10,
"Selected Granules": 6
},
{
"Type": "Skip",
"Name": "t_minmax",
"Description": "minmax GRANULARITY 2",
"Initial Parts": 2,
"Selected Parts": 1,
"Initial Granules": 6,
"Selected Granules": 3
}
]
}
]
}
]
}
}
]
-----------------
ReadFromMergeTree (default.test_index)
ReadType: InOrder

View File

@ -5,42 +5,45 @@ CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CURDIR"/../shell_config.sh
CLICKHOUSE_CLIENT="$CLICKHOUSE_CLIENT --optimize_move_to_prewhere=1 --convert_query_to_cnf=0 --optimize_read_in_order=1"
for i in $(seq 0 1)
do
CH_CLIENT="$CLICKHOUSE_CLIENT --optimize_move_to_prewhere=1 --convert_query_to_cnf=0 --optimize_read_in_order=1 --allow_experimental_analyzer=$i"
$CLICKHOUSE_CLIENT -q "drop table if exists test_index"
$CLICKHOUSE_CLIENT -q "drop table if exists idx"
$CH_CLIENT -q "drop table if exists test_index"
$CH_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, min_bytes_for_wide_part = 0, ratio_of_defaults_for_sparse_serialization = 1"
$CLICKHOUSE_CLIENT -q "insert into test_index select number, number > 3 ? 3 : number, number = 1 ? 1 : 0, number from numbers(20)"
$CH_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, ratio_of_defaults_for_sparse_serialization = 1"
$CH_CLIENT -q "insert into test_index select number, number > 3 ? 3 : number, number = 1 ? 1 : 0, number from numbers(20)"
$CLICKHOUSE_CLIENT -q "
$CH_CLIENT -q "
explain indexes = 1 select *, _part from test_index where t % 19 = 16 and y > 0 and bitAnd(z, 3) != 1 and x > 10 and t % 20 > 14;
" | grep -A 100 "ReadFromMergeTree" # | grep -v "Description"
echo "-----------------"
echo "-----------------"
$CLICKHOUSE_CLIENT -q "
$CH_CLIENT -q "
explain indexes = 1, json = 1 select *, _part from test_index where t % 19 = 16 and y > 0 and bitAnd(z, 3) != 1 and x > 10 and t % 20 > 14 format TSVRaw;
" | grep -A 100 "ReadFromMergeTree" # | grep -v "Description"
echo "-----------------"
echo "-----------------"
$CLICKHOUSE_CLIENT -q "
$CH_CLIENT -q "
explain actions = 1 select x from test_index where x > 15 order by x;
" | grep -A 100 "ReadFromMergeTree"
echo "-----------------"
echo "-----------------"
$CLICKHOUSE_CLIENT -q "
$CH_CLIENT -q "
explain actions = 1 select x from test_index where x > 15 order by x desc;
" | grep -A 100 "ReadFromMergeTree"
$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, ratio_of_defaults_for_sparse_serialization = 1"
$CLICKHOUSE_CLIENT -q "insert into idx select number, number, number from numbers(10)"
$CH_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, ratio_of_defaults_for_sparse_serialization = 1"
$CH_CLIENT -q "insert into idx select number, number, number from numbers(10)"
$CLICKHOUSE_CLIENT -q "
$CH_CLIENT -q "
explain indexes = 1 select z from idx where not(x + y + 1 > 2 and x not in (4, 5))
" | grep -A 100 "ReadFromMergeTree"
$CLICKHOUSE_CLIENT -q "drop table if exists test_index"
$CLICKHOUSE_CLIENT -q "drop table if exists idx"
$CH_CLIENT -q "drop table if exists test_index"
$CH_CLIENT -q "drop table if exists idx"
done