fix(sqlengine): reduce memory reserve size when topk is too big (#10)

This commit is contained in:
egolearner 2026-01-06 20:33:08 +08:00 committed by GitHub
parent e641408910
commit 788ecd5ee8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -617,10 +617,11 @@ Result<PlanInfo::Ptr> QueryPlanner::invert_scan(
}
int QueryPlanner::get_batch_size(const QueryInfo &info, bool has_later_filter) {
// ref https://arrow.apache.org/docs/developers/cpp/acero.html#batch-size
if (!info.query_orderbys().empty() || has_later_filter) {
return 32 * 1024;
}
return info.query_topn();
return std::min(info.query_topn(), 32U * 1024);
}
} // namespace zvec::sqlengine