mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Fix
This commit is contained in:
parent
3cb35efb31
commit
ea15ad4ff5
@ -286,11 +286,13 @@ public:
|
||||
void forEachSubcolumn(MutableColumnCallback callback) override
|
||||
{
|
||||
callback(variant_column);
|
||||
variant_column_ptr = assert_cast<ColumnVariant *>(variant_column.get());
|
||||
}
|
||||
|
||||
void forEachSubcolumnRecursively(RecursiveMutableColumnCallback callback) override
|
||||
{
|
||||
callback(*variant_column);
|
||||
variant_column_ptr = assert_cast<ColumnVariant *>(variant_column.get());
|
||||
variant_column->forEachSubcolumnRecursively(callback);
|
||||
}
|
||||
|
||||
@ -364,6 +366,9 @@ private:
|
||||
void updateVariantInfoAndExpandVariantColumn(const DataTypePtr & new_variant_type);
|
||||
|
||||
WrappedPtr variant_column;
|
||||
/// Store and use pointer to ColumnVariant to avoid virtual calls.
|
||||
/// ColumnDynamic is widely used inside ColumnObject for each path and
|
||||
/// with hundreds of paths these virtual calls are noticeable.
|
||||
ColumnVariant * variant_column_ptr;
|
||||
/// Store the type of current variant with some additional information.
|
||||
VariantInfo variant_info;
|
||||
|
@ -955,8 +955,11 @@ void ColumnObject::forEachSubcolumn(DB::IColumn::MutableColumnCallback callback)
|
||||
{
|
||||
for (auto & [_, column] : typed_paths)
|
||||
callback(column);
|
||||
for (auto & [_, column] : dynamic_paths)
|
||||
for (auto & [path, column] : dynamic_paths)
|
||||
{
|
||||
callback(column);
|
||||
dynamic_paths_ptrs[path] = assert_cast<ColumnDynamic *>(column.get());
|
||||
}
|
||||
callback(shared_data);
|
||||
}
|
||||
|
||||
@ -967,10 +970,11 @@ void ColumnObject::forEachSubcolumnRecursively(DB::IColumn::RecursiveMutableColu
|
||||
callback(*column);
|
||||
column->forEachSubcolumnRecursively(callback);
|
||||
}
|
||||
for (auto & [_, column] : dynamic_paths_ptrs)
|
||||
for (auto & [path, column] : dynamic_paths)
|
||||
{
|
||||
callback(*column);
|
||||
column->forEachSubcolumnRecursively(callback);
|
||||
dynamic_paths_ptrs[path] = assert_cast<ColumnDynamic *>(column.get());
|
||||
}
|
||||
callback(*shared_data);
|
||||
shared_data->forEachSubcolumnRecursively(callback);
|
||||
|
@ -201,6 +201,8 @@ private:
|
||||
/// here are Dynamic columns. This set of paths can be extended
|
||||
/// during inerts into the column.
|
||||
std::unordered_map<String, WrappedPtr> dynamic_paths;
|
||||
/// Store and use pointers to ColumnDynamic to avoid virtual calls.
|
||||
/// With hundreds of dynamic paths these virtual calls are noticeable.
|
||||
std::unordered_map<String, ColumnDynamic *> dynamic_paths_ptrs;
|
||||
/// Shared storage for all other paths and values. It's filled
|
||||
/// when the number of dynamic paths reaches the limit.
|
||||
|
@ -2117,6 +2117,7 @@ natively
|
||||
nats
|
||||
nestjs
|
||||
netloc
|
||||
newjson
|
||||
ngram
|
||||
ngramDistance
|
||||
ngramDistanceCaseInsensitive
|
||||
|
Loading…
Reference in New Issue
Block a user