|
28 | 28 | #include <ydb/core/kqp/opt/kqp_query_plan.h> |
29 | 29 | #include <ydb/core/kqp/rm_service/kqp_rm_service.h> |
30 | 30 | #include <ydb/core/grpc_services/local_rate_limiter.h> |
| 31 | +#include <ydb/core/kqp/common/control.h> |
31 | 32 |
|
32 | 33 | #include <ydb/services/metadata/secret/fetcher.h> |
33 | 34 | #include <ydb/services/metadata/secret/snapshot.h> |
@@ -146,6 +147,7 @@ class TKqpExecuterBase : public TActorBootstrapped<TDerived> { |
146 | 147 | , StreamResult(streamResult) |
147 | 148 | , StatementResultIndex(statementResultIndex) |
148 | 149 | { |
| 150 | + EnableReadsMerge = *MergeDatashardReadsControl() == 1; |
149 | 151 | TasksGraph.GetMeta().Snapshot = IKqpGateway::TKqpSnapshot(Request.Snapshot.Step, Request.Snapshot.TxId); |
150 | 152 | TasksGraph.GetMeta().Arena = MakeIntrusive<NActors::TProtoArenaHolder>(); |
151 | 153 | TasksGraph.GetMeta().Database = Database; |
@@ -1084,7 +1086,11 @@ class TKqpExecuterBase : public TActorBootstrapped<TDerived> { |
1084 | 1086 | return result; |
1085 | 1087 | } |
1086 | 1088 |
|
1087 | | - TMaybe<size_t> BuildScanTasksFromSource(TStageInfo& stageInfo, const bool shardsResolved, const bool limitTasksPerNode) { |
| 1089 | + TMaybe<size_t> BuildScanTasksFromSource(TStageInfo& stageInfo, const bool shardsResolved, bool limitTasksPerNode) { |
| 1090 | + if (EnableReadsMerge) { |
| 1091 | + limitTasksPerNode = true; |
| 1092 | + } |
| 1093 | + |
1088 | 1094 | THashMap<ui64, std::vector<ui64>> nodeTasks; |
1089 | 1095 | THashMap<ui64, ui64> assignedShardsCount; |
1090 | 1096 |
|
@@ -2026,6 +2032,7 @@ class TKqpExecuterBase : public TActorBootstrapped<TDerived> { |
2026 | 2032 |
|
2027 | 2033 | ui32 StatementResultIndex; |
2028 | 2034 | bool AlreadyReplied = false; |
| 2035 | + bool EnableReadsMerge = false; |
2029 | 2036 |
|
2030 | 2037 | private: |
2031 | 2038 | static constexpr TDuration ResourceUsageUpdateInterval = TDuration::MilliSeconds(100); |
|
0 commit comments