mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
dbms: lowered memory usage of huge ORDER BY with small LIMIT [#METR-2944].
This commit is contained in:
parent
da86564110
commit
f4ea556a30
@ -11,6 +11,11 @@ Block PartialSortingBlockInputStream::readImpl()
|
||||
{
|
||||
Block res = children.back()->read();
|
||||
sortBlock(res, description, limit);
|
||||
|
||||
if (limit && res.rowsInFirstColumn() > limit)
|
||||
for (size_t i = 0, size = res.columns(); i < size; ++i)
|
||||
res.getByPosition(i).column = res.getByPosition(i).column->cut(0, limit);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user