-
Notifications
You must be signed in to change notification settings - Fork 489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add "HISTOGRAM" option in "ALTER TABLE... UPDATE/DROP..." #925
Conversation
Codecov Report
@@ Coverage Diff @@
## master #925 +/- ##
==========================================
+ Coverage 78.43% 78.46% +0.02%
==========================================
Files 40 40
Lines 14897 14805 -92
==========================================
- Hits 11685 11617 -68
+ Misses 2521 2501 -20
+ Partials 691 687 -4 |
ast/stats.go
Outdated
@@ -90,6 +110,18 @@ func (n *AnalyzeTableStmt) Restore(ctx *format.RestoreCtx) error { | |||
} | |||
ctx.WriteName(partition.O) | |||
} | |||
if n.HistogramOperation != HistogramOperationNop { | |||
ctx.WriteKeyWord(" " + HistogramOperationString[n.HistogramOperation] + " ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctx.WriteKeyWord(" " + HistogramOperationString[n.HistogramOperation] + " ") | |
ctx.WritePlain(" ") | |
ctx.WriteKeyWord(n.HistogramOperation.String()) | |
ctx.WritePlain(" ") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
thx a lot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@kennytm,Thanks for your review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the PR title wrong? It should be ANALYZE TABLE ... UPDATE / DROP ...
.
Besides, according to your PR description, why is ANALYZE TABLE
t1UPDATE HISTOGRAM ON
b WITH 1024 BUCKETS
a bad sql?
Sorry for not explaining the title properly. The situation is that there has been a statement According to your comment, the title will be corrected. |
98814c8
to
a04581a
Compare
Reference: https://dev.mysql.com/doc/refman/8.0/en/analyze-table.html Signed-off-by: wangggong <793160615@qq.com>
Signed-off-by: wangggong <793160615@qq.com>
a04581a
to
e52563e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Wang Ruichao wangruichao2014@xiaochuankeji.cn
What problem does this PR solve?
Close #361 , cc pingcap/tidb#14800
Bad SQL:
What is changed and how it works?
Add "ALTER TABLE... UPDATE/DROP HISTOGRAM" in parser.y, according to the document of mysql: https://dev.mysql.com/doc/refman/8.0/en/analyze-table.html
Check List
Tests