From 833456b412a419378277ccb14deba7ed4b030a1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniil=20Timi=C5=BEev?= Date: Fri, 14 Nov 2025 22:12:23 +0300 Subject: [PATCH] Sequential reads for BATCH queries (#28906) --- ydb/core/kqp/runtime/kqp_read_actor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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}; }