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

@@ -659,6 +659,14 @@ public:
};
enum class hint_state
{
NOT_PRESENT, // Hint is not specified
ENABLED, // Hint is specified as enabled
DISABLED // Hint is specified as disabled
};
/**
Returns key hint value if hint is specified, returns
optimizer switch value if hint is not specified.
@@ -706,6 +714,14 @@ bool hint_table_state(const THD *thd, const TABLE_LIST *table_list,
bool hint_table_state(const THD *thd, const TABLE *table,
opt_hints_enum type_arg, bool fallback_value);
/*
Similar to above but returns hint_state enum
*/
hint_state hint_table_state(const THD *thd,
const TABLE_LIST *table_list,
opt_hints_enum type_arg);
#ifndef DBUG_OFF
const char *dbug_print_hints(Opt_hints_qb *hint);
#endif