mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-33281 Implement optimizer hints
This commit introduces: - the infrastructure for optimizer hints; - hints for join buffering: BNL(), NO_BNL(), BKA(), NO_BKA(); - NO_ICP() hint for disabling index condition pushdown; - MRR(), MO_MRR() hint for multi-range reads control; - NO_RANGE_OPTIMIZATION() for disabling range optimization; - QB_NAME() for assigning names for query blocks.
This commit is contained in:
@@ -23,6 +23,19 @@
|
||||
#include "sql_list.h"
|
||||
#include "simple_parser.h"
|
||||
|
||||
class st_select_lex;
|
||||
|
||||
/**
|
||||
Environment data for the name resolution phase
|
||||
*/
|
||||
struct Parse_context {
|
||||
THD * const thd; ///< Current thread handler
|
||||
MEM_ROOT *mem_root; ///< Current MEM_ROOT
|
||||
st_select_lex * select; ///< Current SELECT_LEX object
|
||||
|
||||
Parse_context(THD *thd, st_select_lex *select);
|
||||
};
|
||||
|
||||
|
||||
class Optimizer_hint_tokenizer: public Extended_string_tokenizer
|
||||
{
|
||||
@@ -513,7 +526,6 @@ private:
|
||||
using OR2::OR2;
|
||||
};
|
||||
|
||||
|
||||
// table_level_hint ::= table_level_hint_type ( table_level_hint_body )
|
||||
class Table_level_hint: public AND4<PARSER,
|
||||
Table_level_hint_type,
|
||||
@@ -523,6 +535,8 @@ private:
|
||||
{
|
||||
public:
|
||||
using AND4::AND4;
|
||||
|
||||
bool resolve(Parse_context *pc) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -545,6 +559,8 @@ private:
|
||||
{
|
||||
public:
|
||||
using AND4::AND4;
|
||||
|
||||
bool resolve(Parse_context *pc) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -557,6 +573,8 @@ private:
|
||||
{
|
||||
public:
|
||||
using AND4::AND4;
|
||||
|
||||
bool resolve(Parse_context *pc) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -572,6 +590,7 @@ private:
|
||||
{
|
||||
public:
|
||||
using OR3::OR3;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -592,6 +611,8 @@ public:
|
||||
{
|
||||
public:
|
||||
using LIST::LIST;
|
||||
|
||||
bool resolve(Parse_context *pc);
|
||||
};
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user