mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Merge pull request #22999 from azat/no-optimize_skip_unused_shards-single-node
Do not perform optimize_skip_unused_shards for cluster with one node
This commit is contained in:
commit
e361f5943f
@ -469,7 +469,7 @@ QueryProcessingStage::Enum StorageDistributed::getQueryProcessingStage(
|
|||||||
|
|
||||||
/// Always calculate optimized cluster here, to avoid conditions during read()
|
/// Always calculate optimized cluster here, to avoid conditions during read()
|
||||||
/// (Anyway it will be calculated in the read())
|
/// (Anyway it will be calculated in the read())
|
||||||
if (settings.optimize_skip_unused_shards)
|
if (getClusterQueriedNodes(settings, cluster) > 1 && settings.optimize_skip_unused_shards)
|
||||||
{
|
{
|
||||||
ClusterPtr optimized_cluster = getOptimizedCluster(local_context, metadata_snapshot, query_info.query);
|
ClusterPtr optimized_cluster = getOptimizedCluster(local_context, metadata_snapshot, query_info.query);
|
||||||
if (optimized_cluster)
|
if (optimized_cluster)
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
-- remote() does not have sharding key, while force_optimize_skip_unused_shards=2 requires from table to have it.
|
||||||
|
-- But due to only one node, everything works.
|
||||||
|
select * from remote('127.1', system.one) settings optimize_skip_unused_shards=1, force_optimize_skip_unused_shards=2 format Null;
|
Loading…
Reference in New Issue
Block a user