1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-36092 New-style hint: [NO_]SPLIT_MATERIALIZED

Support for optimizer hints NO_SPLIT_MATERIALIZED and
SPLIT_MATERIALIZED.  These hints allow fine-grained control
of the "lateral derived" optimization within a query.

Introduces new overload of hint_table_state function which
tells both a hint's value as well as whether it is present.
This is useful to disambiguate cases that the other version
of hint_table_state cannot, such as when a hint is forcing
a behavior in the optimizer that it would not normally do
and the corresponding optimizer switch is enabled.
This commit is contained in:
Dave Gosselin
2025-04-24 15:03:05 -04:00
committed by Dave Gosselin
parent 07d71fdcf8
commit 62a1f0d990
8 changed files with 1467 additions and 26 deletions

View File

@@ -134,11 +134,15 @@ Optimizer_hint_tokenizer::find_keyword(const LEX_CSTRING &str)
case 18:
if ("MAX_EXECUTION_TIME"_Lex_ident_column.streq(str))
return TokenID::keyword_MAX_EXECUTION_TIME;
if ("SPLIT_MATERIALIZED"_Lex_ident_column.streq(str))
return TokenID::keyword_SPLIT_MATERIALIZED;
break;
case 21:
if ("NO_RANGE_OPTIMIZATION"_Lex_ident_column.streq(str))
return TokenID::keyword_NO_RANGE_OPTIMIZATION;
if ("NO_SPLIT_MATERIALIZED"_Lex_ident_column.streq(str))
return TokenID::keyword_NO_SPLIT_MATERIALIZED;
break;
case 26:
@@ -342,21 +346,29 @@ bool Parser::Table_level_hint::resolve(Parse_context *pc) const
hint_state= false;
break;
case TokenID::keyword_DERIVED_CONDITION_PUSHDOWN:
hint_type= DERIVED_CONDITION_PUSHDOWN_HINT_ENUM;
hint_state= true;
break;
hint_type= DERIVED_CONDITION_PUSHDOWN_HINT_ENUM;
hint_state= true;
break;
case TokenID::keyword_NO_DERIVED_CONDITION_PUSHDOWN:
hint_type= DERIVED_CONDITION_PUSHDOWN_HINT_ENUM;
hint_state= false;
break;
hint_type= DERIVED_CONDITION_PUSHDOWN_HINT_ENUM;
hint_state= false;
break;
case TokenID::keyword_MERGE:
hint_type= MERGE_HINT_ENUM;
hint_state= true;
break;
hint_type= MERGE_HINT_ENUM;
hint_state= true;
break;
case TokenID::keyword_NO_MERGE:
hint_type= MERGE_HINT_ENUM;
hint_state= false;
break;
hint_type= MERGE_HINT_ENUM;
hint_state= false;
break;
case TokenID::keyword_SPLIT_MATERIALIZED:
hint_type= SPLIT_MATERIALIZED_HINT_ENUM;
hint_state= true;
break;
case TokenID::keyword_NO_SPLIT_MATERIALIZED:
hint_type= SPLIT_MATERIALIZED_HINT_ENUM;
hint_state= false;
break;
default:
DBUG_ASSERT(0);
return true;