diff options
author | ssmike <ssmike@ydb.tech> | 2023-07-21 23:13:57 +0300 |
---|---|---|
committer | ssmike <ssmike@ydb.tech> | 2023-07-21 23:13:57 +0300 |
commit | d881df4c4be0be12365f4c000d8fb8e2d9c71821 (patch) | |
tree | f460eba65158c9df361603b0a0c228f5032798cc | |
parent | 8c757b34f8d53a91d81de2f32454749dd7ff0ff5 (diff) | |
download | ydb-d881df4c4be0be12365f4c000d8fb8e2d9c71821.tar.gz |
fix shard hint for sequential reads
-rw-r--r-- | ydb/core/kqp/executer_actor/kqp_partition_helper.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/ydb/core/kqp/executer_actor/kqp_partition_helper.cpp b/ydb/core/kqp/executer_actor/kqp_partition_helper.cpp index c29ddd65cf1..1283f323b8d 100644 --- a/ydb/core/kqp/executer_actor/kqp_partition_helper.cpp +++ b/ydb/core/kqp/executer_actor/kqp_partition_helper.cpp @@ -599,15 +599,6 @@ std::pair<ui64, TShardInfo> MakeVirtualTablePartition(const TKqpTableKeys& table const auto& keyColumnTypes = table->KeyColumnTypes; auto ranges = ExtractRanges(tableKeys, source, stageInfo, holderFactory, typeEnv, guard); - TShardInfo result; - for (auto& range: ranges) { - if (!result.KeyReadRanges) { - result.KeyReadRanges.ConstructInPlace(); - } - - result.KeyReadRanges->Add(std::move(range)); - } - ui64 shard = 0; if (!ranges.empty()) { auto& range = source.GetReverse() ? ranges.back() : ranges[0]; @@ -624,6 +615,14 @@ std::pair<ui64, TShardInfo> MakeVirtualTablePartition(const TKqpTableKeys& table } } + TShardInfo result; + for (auto& range: ranges) { + if (!result.KeyReadRanges) { + result.KeyReadRanges.ConstructInPlace(); + } + + result.KeyReadRanges->Add(std::move(range)); + } return {shard, result}; } |