Skip to content

Commit 20ac289

Browse files
fix corner case for memory prediction (#4856)
1 parent e8076a8 commit 20ac289

File tree

1 file changed

+1
-1
lines changed
  • ydb/core/tx/columnshard/engines/reader/plain_reader/iterator

1 file changed

+1
-1
lines changed

ydb/core/tx/columnshard/engines/reader/plain_reader/iterator/context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ui64 TSpecialReadContext::GetMemoryForSources(const THashMap<ui32, std::shared_p
1313
for (auto&& i : sources) {
1414
auto fetchingPlan = GetColumnsFetchingPlan(i.second);
1515
AFL_VERIFY(i.second->GetIntervalsCount());
16-
const ui64 sourceMemory = fetchingPlan->PredictRawBytes(i.second) / i.second->GetIntervalsCount();
16+
const ui64 sourceMemory = std::max<ui64>(1, fetchingPlan->PredictRawBytes(i.second) / i.second->GetIntervalsCount());
1717
if (!i.second->IsSourceInMemory()) {
1818
hasSequentialReadSources = true;
1919
}

0 commit comments

Comments
 (0)