diff --git a/src/Interpreters/InterpreterInsertQuery.cpp b/src/Interpreters/InterpreterInsertQuery.cpp index 44e2baf12a92..debf5ee4012a 100644 --- a/src/Interpreters/InterpreterInsertQuery.cpp +++ b/src/Interpreters/InterpreterInsertQuery.cpp @@ -516,10 +516,10 @@ BlockIO InterpreterInsertQuery::execute() auto table_id = table->getStorageID(); auto views = DatabaseCatalog::instance().getDependentViews(table_id); - /// TODO: should we really skip views or not? they have special `parallel_view_processing`, it should be enough? - pre_streams_size = !table->isView() && views.empty() - ? settings.max_insert_threads - : std::min(settings.max_insert_threads, pipeline.getNumStreams()); + /// It breaks some views-related tests and we have dedicated `parallel_view_processing` for views, so let's just skip them. + const bool resize_to_max_insert_threads = !table->isView() && views.empty(); + pre_streams_size = resize_to_max_insert_threads ? settings.max_insert_threads + : std::min(settings.max_insert_threads, pipeline.getNumStreams()); if (table->supportsParallelInsert()) sink_streams_size = pre_streams_size; } diff --git a/src/Processors/Transforms/buildPushingToViewsChain.cpp b/src/Processors/Transforms/buildPushingToViewsChain.cpp index 40f4166283b3..0ff39c76788d 100644 --- a/src/Processors/Transforms/buildPushingToViewsChain.cpp +++ b/src/Processors/Transforms/buildPushingToViewsChain.cpp @@ -65,7 +65,6 @@ struct ViewsData StorageID source_storage_id; StorageMetadataPtr source_metadata_snapshot; StoragePtr source_storage; - /// This value is actually only for logs. size_t max_threads = 1; /// In case of exception happened while inserting into main table, it is pushed to pipeline.