parser: allow drop stats of multiple tables#38042
Conversation
|
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. DetailsReviewer can indicate their review by submitting an approval review. |
My short answer: Only allow I have a patch for always enabling GLOBAL stats for partitioned tables here, which I also see as a part of this discussion :) Due to the plans of removing static partition prune mode, I would prefer that we also deprecating the support of partition specific configuration of statistics, and not adding support of dropping stats for a specific partition. Unless there are plans to change the statistic usage for partitioned tables under dynamic prune mode? I propose that we only support ANALYZE table (global) with non-default configuration (like buckets, samples etc.) and only saves the configuration on table/global level. My reasoning is that the partition level statistics is aggregated to table/global level and should not differ in configuration which may result in issues when calculating the table/global statistic. Meaning the following syntax should be supported: And this would be deprecated: |
executor/simple.go
Outdated
There was a problem hiding this comment.
If my proposal that we only support GLOBAL/per table DROP STATS, then I think this should always be done.
37e3413 to
356b6f7
Compare
@mjonss Good answer! IIUC,
PTAL |
962ea79 to
d313663
Compare
mjonss
left a comment
There was a problem hiding this comment.
LGTM, just a minor suggestion on comment change.
|
@YangKeao rebase please, let us merge it. |
Signed-off-by: YangKeao <yangkeao@chunibyo.icu>
|
/merge |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: bebee8b |
I have updated the documents in pingcap/docs-cn#11986 and pingcap/docs#11287. Could you please tech-review these documents? @mjonss @xhebox . I only update the syntax (following the |
TiDB MergeCI notify🔴 Bad News! New failing [1] after this pr merged.
|
Signed-off-by: YangKeao yangkeao@chunibyo.icu
What problem does this PR solve?
Issue Number: close #37872
Problem Summary:
DROP STATSdoesn't allow dropping stats of multiple tables now.What is changed and how it works?
This PR modifies the parser and executors to allow dropping multiple tables without partitions.
The grammar should be discussed, as the
DROP STATS t1, t2 GLOBALandDROP STATS t PARTITION xxxis not consistent now. I'm not sure whether it's expected, or I shouldn't allow dropping multiple tables withGLOBALat the end?Check List
Tests
Release note