mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 15:42:02 +00:00
dbms: improved performance of system.numbers table [#METR-11434].
This commit is contained in:
parent
0ee6ba4b67
commit
647ff835c4
@ -30,11 +30,15 @@ Block NumbersBlockInputStream::readImpl()
|
||||
ColumnUInt64::Container_t & vec = column->getData();
|
||||
column_with_name_and_type.column = column;
|
||||
|
||||
for (size_t i = 0; i < block_size; ++i)
|
||||
vec[i] = next++;
|
||||
size_t curr = next; /// Локальная переменная почему-то работает быстрее (>20%), чем член класса.
|
||||
UInt64 * pos = &vec[0]; /// Это тоже ускоряет код.
|
||||
UInt64 * end = &vec[block_size];
|
||||
while (pos < end)
|
||||
*pos++ = curr++;
|
||||
next = curr;
|
||||
|
||||
res.insert(column_with_name_and_type);
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user