-- { echoOn } select 'optimize_trivial_insert_select=0', 'max_insert_threads=0'; optimize_trivial_insert_select=0 max_insert_threads=0 insert into testX select number from numbers(10) settings log_queries=1, parallel_view_processing=0, optimize_trivial_insert_select=0, max_insert_threads=0; -- { serverError FUNCTION_THROW_IF_VALUE_IS_NON_ZERO } system flush logs; select arrayUniq(thread_ids) from system.query_log where current_database = currentDatabase() and type != 'QueryStart' and query like '%insert into testX %' and Settings['parallel_view_processing'] = '0' and Settings['optimize_trivial_insert_select'] = '0' and Settings['max_insert_threads'] = '0'; 2 select count() from testX; 10 select count() from testXA; 10 select count() from testXB; 0 select count() from testXC; 10 select 'optimize_trivial_insert_select=0', 'max_insert_threads=16'; optimize_trivial_insert_select=0 max_insert_threads=16 insert into testX select number from numbers(10) settings log_queries=1, parallel_view_processing=0, optimize_trivial_insert_select=0, max_insert_threads=16; -- { serverError FUNCTION_THROW_IF_VALUE_IS_NON_ZERO } system flush logs; select arrayUniq(thread_ids) from system.query_log where current_database = currentDatabase() and type != 'QueryStart' and query like '%insert into testX %' and Settings['parallel_view_processing'] = '0' and Settings['optimize_trivial_insert_select'] = '0' and Settings['max_insert_threads'] = '16'; 2 select count() from testX; 20 select count() from testXA; 20 select count() from testXB; 0 select count() from testXC; 20 select 'optimize_trivial_insert_select=1', 'max_insert_threads=0'; optimize_trivial_insert_select=1 max_insert_threads=0 insert into testX select number from numbers(10) settings log_queries=1, parallel_view_processing=0, optimize_trivial_insert_select=1, max_insert_threads=0; -- { serverError FUNCTION_THROW_IF_VALUE_IS_NON_ZERO } system flush logs; select arrayUniq(thread_ids) from system.query_log where current_database = currentDatabase() and type != 'QueryStart' and query like '%insert into testX %' and Settings['parallel_view_processing'] = '0' and Settings['optimize_trivial_insert_select'] = '1' and Settings['max_insert_threads'] = '0'; 2 select count() from testX; 30 select count() from testXA; 30 select count() from testXB; 0 select count() from testXC; 30 select 'optimize_trivial_insert_select=1', 'max_insert_threads=16'; optimize_trivial_insert_select=1 max_insert_threads=16 insert into testX select number from numbers(10) settings log_queries=1, parallel_view_processing=0, optimize_trivial_insert_select=1, max_insert_threads=16; -- { serverError FUNCTION_THROW_IF_VALUE_IS_NON_ZERO } system flush logs; select arrayUniq(thread_ids) from system.query_log where current_database = currentDatabase() and type != 'QueryStart' and query like '%insert into testX %' and Settings['parallel_view_processing'] = '0' and Settings['optimize_trivial_insert_select'] = '1' and Settings['max_insert_threads'] = '16'; 2 select count() from testX; 40 select count() from testXA; 40 select count() from testXB; 0 select count() from testXC; 40 select 'optimize_trivial_insert_select=0', 'max_insert_threads=0'; optimize_trivial_insert_select=0 max_insert_threads=0 insert into testX select number from numbers(10) settings log_queries=1, parallel_view_processing=1, optimize_trivial_insert_select=0, max_insert_threads=0; -- { serverError FUNCTION_THROW_IF_VALUE_IS_NON_ZERO } system flush logs; select arrayUniq(thread_ids) from system.query_log where current_database = currentDatabase() and type != 'QueryStart' and query like '%insert into testX %' and Settings['parallel_view_processing'] = '1' and Settings['optimize_trivial_insert_select'] = '0' and Settings['max_insert_threads'] = '0'; 5 select count() from testX; 50 select count() from testXA; 50 select count() from testXB; 0 select count() from testXC; 50 select 'optimize_trivial_insert_select=0', 'max_insert_threads=16'; optimize_trivial_insert_select=0 max_insert_threads=16 insert into testX select number from numbers(10) settings log_queries=1, parallel_view_processing=1, optimize_trivial_insert_select=0, max_insert_threads=16; -- { serverError FUNCTION_THROW_IF_VALUE_IS_NON_ZERO } system flush logs; select arrayUniq(thread_ids) from system.query_log where current_database = currentDatabase() and type != 'QueryStart' and query like '%insert into testX %' and Settings['parallel_view_processing'] = '1' and Settings['optimize_trivial_insert_select'] = '0' and Settings['max_insert_threads'] = '16'; 5 select count() from testX; 60 select count() from testXA; 60 select count() from testXB; 0 select count() from testXC; 60 select 'optimize_trivial_insert_select=1', 'max_insert_threads=0'; optimize_trivial_insert_select=1 max_insert_threads=0 insert into testX select number from numbers(10) settings log_queries=1, parallel_view_processing=1, optimize_trivial_insert_select=1, max_insert_threads=0; -- { serverError FUNCTION_THROW_IF_VALUE_IS_NON_ZERO } system flush logs; select arrayUniq(thread_ids) from system.query_log where current_database = currentDatabase() and type != 'QueryStart' and query like '%insert into testX %' and Settings['parallel_view_processing'] = '1' and Settings['optimize_trivial_insert_select'] = '1' and Settings['max_insert_threads'] = '0'; 5 select count() from testX; 70 select count() from testXA; 70 select count() from testXB; 0 select count() from testXC; 70 select 'optimize_trivial_insert_select=1', 'max_insert_threads=16'; optimize_trivial_insert_select=1 max_insert_threads=16 insert into testX select number from numbers(10) settings log_queries=1, parallel_view_processing=1, optimize_trivial_insert_select=1, max_insert_threads=16; -- { serverError FUNCTION_THROW_IF_VALUE_IS_NON_ZERO } system flush logs; select arrayUniq(thread_ids) from system.query_log where current_database = currentDatabase() and type != 'QueryStart' and query like '%insert into testX %' and Settings['parallel_view_processing'] = '1' and Settings['optimize_trivial_insert_select'] = '1' and Settings['max_insert_threads'] = '16'; 5 select count() from testX; 80 select count() from testXA; 80 select count() from testXB; 0 select count() from testXC; 80