This commit is contained in:
feng lv 2020-08-02 13:35:58 +08:00
parent edb7c9b2c5
commit 88e48168d9
2 changed files with 5 additions and 4 deletions

View File

@ -395,7 +395,7 @@ class IColumn;
\
M(Bool, force_optimize_skip_unused_shards_no_nested, false, "Obsolete setting, does nothing. Will be removed after 2020-12-01. Use force_optimize_skip_unused_shards_nesting instead.", 0) \
M(Bool, experimental_use_processors, true, "Obsolete setting, does nothing. Will be removed after 2020-11-29.", 0) \
M(SettingBool, optimize_trivial_insert_select, true, "Optimize trivial 'INSERT INTO table SELECT ... FROM TABLES' query", 0) \
M(Bool, optimize_trivial_insert_select, true, "Optimize trivial 'INSERT INTO table SELECT ... FROM TABLES' query", 0) \
#define FORMAT_FACTORY_SETTINGS(M) \
M(Char, format_csv_delimiter, ',', "The character to be considered as a delimiter in CSV data. If setting with a string, a string has to have a length of 1.", 0) \

View File

@ -202,9 +202,10 @@ BlockIO InterpreterInsertQuery::execute()
if (query.select)
{
auto optimize_trivial_insert_select = settings.optimize_trivial_insert_select;
if(optimize_trivial_insert_select)
{
auto is_trivial_select = [](const auto query_) {
if (optimize_trivial_insert_select)
{
auto is_trivial_select = [](const auto query_)
{
if (query_.tables())
{
const auto & tables_in_select_query = query_.tables()->template as<ASTTablesInSelectQuery &>();