diff --git a/src/Interpreters/InterpreterInsertQuery.cpp b/src/Interpreters/InterpreterInsertQuery.cpp index 33cfe4bf7a2..ea5fd9d0d7a 100644 --- a/src/Interpreters/InterpreterInsertQuery.cpp +++ b/src/Interpreters/InterpreterInsertQuery.cpp @@ -200,6 +200,8 @@ BlockIO InterpreterInsertQuery::execute() if (is_trivial_insert_select) { + fmt::print(stderr, "is trivial insert select\n"); + /** When doing trivial INSERT INTO ... SELECT ... FROM table, * don't need to process SELECT with more than max_insert_threads * and it's reasonable to set block size for SELECT to the desired block size for INSERT @@ -210,8 +212,13 @@ BlockIO InterpreterInsertQuery::execute() new_settings.max_threads = std::max(1, settings.max_insert_threads); - if (settings.min_insert_block_size_rows && table->prefersLargeBlocks()) - new_settings.max_block_size = settings.min_insert_block_size_rows; + if (table->prefersLargeBlocks()) + { + if (settings.min_insert_block_size_rows) + new_settings.max_block_size = settings.min_insert_block_size_rows; + if (settings.min_insert_block_size_bytes) + new_settings.preferred_block_size_bytes = settings.min_insert_block_size_bytes; + } auto new_context = Context::createCopy(context); new_context->setSettings(new_settings);