mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-11 01:54:55 +00:00
cache ExpressionBlockInputStream header
This commit is contained in:
parent
aba710a70e
commit
4a5e2dfd3c
@ -23,9 +23,13 @@ Block ExpressionBlockInputStream::getTotals()
|
||||
|
||||
Block ExpressionBlockInputStream::getHeader() const
|
||||
{
|
||||
Block res = children.back()->getHeader();
|
||||
expression->execute(res, true);
|
||||
return res;
|
||||
if (!cached_header.columns())
|
||||
{
|
||||
cached_header = children.back()->getHeader();
|
||||
expression->execute(cached_header, true);
|
||||
}
|
||||
|
||||
return cached_header.cloneEmpty();
|
||||
}
|
||||
|
||||
Block ExpressionBlockInputStream::readImpl()
|
||||
|
@ -30,6 +30,7 @@ protected:
|
||||
|
||||
private:
|
||||
ExpressionActionsPtr expression;
|
||||
mutable Block cached_header;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user