Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
534060f2
Commit
534060f2
authored
Sep 11, 2024
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add an overview comment about hints
parent
655892e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
1 deletion
+44
-1
sql/opt_hints.h
sql/opt_hints.h
+44
-1
No files found.
sql/opt_hints.h
View file @
534060f2
...
...
@@ -15,7 +15,50 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/*
Parse tree node classes for optimizer hint syntax
HintsArchitecture
== Parsing ==
Hints have a separate parser, see sql/opt_hint_parser.{h,cc}
The parser is invoked separately for each occurence of
SELECT / *+ hint_body * / ...
in the query. The result of parsing is saved in
SELECT_LEX::parsed_optimizer_hints.
== Hint "resolution" ==
This is done using "resolve" method of parsed data structures
This process
- Creates interpreted hint structures: Opt_hints_global, Opt_hints_qb,
Opt_hints_table, Opt_hints_key.
- Interprets QB_NAME hints and assigns Query Block names.
- Table-level hints are put into their Query Block's Opt_hints_qb object.
- Index-level hints are put into their table's Opt_hints_table object.
== Hint "adjustment" ==
During Name Resolution, setup_tables() calls adjust_table_hints() for each
table and sets TABLE_LIST::opt_hints_table to point to its Opt_hints_table.
== Hint hierarchy ==
Hints have this hierarchy, parent to child:
Opt_hints_global
Opt_hints_qb
Opt_hints_table
Opt_hints_key
For some hints, one needs to check the hint's base object and its parent. For
example, MRR can be disabled on a per-index or a per-table basis.
== How the optimizer checks hints ==
The optimizer checks what hints specify using these calls:
hint_table_state()
hint_table_state_or_fallback()
hint_key_state()
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment