diff --git a/ydb/core/kqp/runtime/kqp_read_actor.cpp b/ydb/core/kqp/runtime/kqp_read_actor.cpp index bff5763f4d3d..62b6ace32450 100644 --- a/ydb/core/kqp/runtime/kqp_read_actor.cpp +++ b/ydb/core/kqp/runtime/kqp_read_actor.cpp @@ -463,7 +463,7 @@ class TKqpReadActor : public TActorBootstrapped, public NYql::NDq } bool StartShards() { - const ui32 maxAllowedInFlight = Settings->GetSorted() ? 1 : MaxInFlight; + const ui32 maxAllowedInFlight = Settings->GetSorted() || Settings->GetIsBatch() ? 1 : MaxInFlight; CA_LOG_D("effective maxinflight " << maxAllowedInFlight << " sorted " << Settings->GetSorted()); bool isFirst = true; while (!PendingShards.Empty() && RunningReads() + 1 <= maxAllowedInFlight) { @@ -1069,7 +1069,7 @@ class TKqpReadActor : public TActorBootstrapped, public NYql::NDq ui64 seqNo = record.GetSeqNo(); Reads[id].RegisterMessage(msg); - if (Settings->GetIsBatch() && msg.GetRowsCount() > 0) { + if (Settings->GetIsBatch() && msg.GetRowsCount() > 0 && BatchOperationMaxRow.GetCells().empty()) { auto cells = msg.GetCells(msg.GetRowsCount() - 1); BatchOperationMaxRow = TSerializedCellVec{cells}; }