parser: add several optimizer hints#424
Conversation
208793b to
c85b15d
Compare
Codecov Report
@@ Coverage Diff @@
## master #424 +/- ##
==========================================
- Coverage 70.66% 70.48% -0.19%
==========================================
Files 32 32
Lines 7436 7456 +20
==========================================
Hits 5255 5255
- Misses 1666 1686 +20
Partials 515 515
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #424 +/- ##
==========================================
- Coverage 71.12% 71.07% -0.05%
==========================================
Files 32 32
Lines 7542 7540 -2
==========================================
- Hits 5364 5359 -5
- Misses 1662 1665 +3
Partials 516 516
Continue to review full report at Codecov.
|
99ef044 to
71ccd47
Compare
f4e7abd to
c36e23c
Compare
|
Now only And integration test fails because it rely on pingcap/tidb#11673. |
c36e23c to
554c383
Compare
| $$ = getUint64FromNUM($1) | ||
| case "g": | ||
| $$ = getUint64FromNUM($1) * 1024 | ||
| default: |
There was a problem hiding this comment.
Do we have better way to do this?
There was a problem hiding this comment.
Why not add a syntax for memory unit? Or you cannot raise the right warnings since the quota maybe 0M.
There was a problem hiding this comment.
Since syntax start with number and contains a-zA-Z is difficult to handle, we may not be able to use syntax like 233M. And in my opinion, M and G should not become a keyword, so...
There was a problem hiding this comment.
now we can use MEMORY_QUOTA(233 M)
|
PTAL. @lzmhhh123 @lamxTyler |
| "IS": is, | ||
| "ISSUER": issuer, | ||
| "ISOLATION": isolation, | ||
| "USE_TOJA": hintUseToja, |
There was a problem hiding this comment.
Convert in subquery into inner join and aggregation. Seems like this one.
The name is advised by product team.
There was a problem hiding this comment.
How about adding a comment for this abbreviation.
There was a problem hiding this comment.
Okay, and I will contact PM team also.
| { | ||
| $$ = &ast.TableOptimizerHint{HintName: model.NewCIStr($1)} | ||
| } | ||
| | hintNoIndexMerge |
There was a problem hiding this comment.
Why it cannot specify table names?
There was a problem hiding this comment.
It's just a switch to disable this optimizer rule.
Also advised by product team...
| "IS": is, | ||
| "ISSUER": issuer, | ||
| "ISOLATION": isolation, | ||
| "USE_TOJA": hintUseToja, |
There was a problem hiding this comment.
How about adding a comment for this abbreviation.
| { | ||
| $$ = &ast.TableOptimizerHint{HintName: model.NewCIStr($1)} | ||
| } | ||
| | hintReadConsistentReplica |
There was a problem hiding this comment.
Is this one enforce table read from follower or learner?
There was a problem hiding this comment.
Does it also need a table list?
There was a problem hiding this comment.
This is depend on TiKV. It will not be used in 4.0GA, so it's just a draft.
There was a problem hiding this comment.
It's about read from follower, but it's not clear to enforce, advise or enable.
| $$ = false | ||
| } | ||
|
|
||
| HintQueryType: |
There was a problem hiding this comment.
how about change:
| HintQueryType: | |
| HintSQLType: |
There was a problem hiding this comment.
You mean change hint name from "query_type" into "sql_type" ?
05bad36 to
9df303f
Compare
|
PTAL. @lzmhhh123 @lamxTyler . |
|
@foreyes pls resolve the conflicts, then LGTM. |
9df303f to
0a13108
Compare
What problem does this PR solve?
Add optimizer hints.
What is changed and how it works?
Change
TableOptimizerHintstruct, changeparser.y, add tests.Check List
Tests
Code changes
Related changes