-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
statistics: build global statistics for table partition #18717
Conversation
Codecov Report
@@ Coverage Diff @@
## master #18717 +/- ##
================================================
+ Coverage 79.0545% 79.2412% +0.1866%
================================================
Files 546 546
Lines 148433 148313 -120
================================================
+ Hits 117343 117525 +182
+ Misses 21614 21289 -325
- Partials 9476 9499 +23 |
/run-all-tests |
ddl/ddl_api.go
Outdated
func handleTableOptions(options []*ast.TableOption, tbInfo *model.TableInfo) error { | ||
func handleTableOptions(ctx sessionctx.Context, options []*ast.TableOption, tbInfo *model.TableInfo) error { | ||
if !tryOldPartitionImplementation(ctx) && tbInfo.Partition != nil && len(tbInfo.Partition.Definitions) > 0 { | ||
tbInfo.IsNewPartition = true |
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.
Why store this info?
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.
emmm..we need one method to cut off old stats to new stats...
current code chooses new partition tables use new stats and old partition tables use old stats, and add IsNewPartition
flag to mark it...maybe we need more discuss about how to "switch old stats to new stats" or "switch old partition to new partition"
tryOldPartitionImplementation
at here, just make test can run test in both new/old stats format.
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.
tryOldPartitionImplementation
is a runtime flag.
I mean, do we have to persistent the flag in the model.TableInfo? That flag is stored in the storage, and may bring compatible issue.
@tiancaiamao this pr became too large, I will split it tody - -~ |
cmd/explaintest/r/select.result
Outdated
TableReader_7 10.00 root partition:all data:Selection_6 | ||
└─Selection_6 10.00 cop[tikv] eq(test.th.a, -2) | ||
└─TableFullScan_5 10000.00 cop[tikv] table:th keep order:false, stats:pseudo | ||
TableReader_7 1.00 root partition:all data:Selection_6 |
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.
we cannot get a stable est count after change to global status that range query using sample based column histogram.
(before this pr it's full tablescan and can use table count directly)
so need improve explain test firstly - -
/run-all-tests tikv=pr/8443 |
/run-integration-ddl-test tikv=pr/8443 |
/rebuild |
/run-unit-test |
/run-all-tests |
/run-integration-compatibility-test |
/run-all-tests |
/run-check_dev_2 |
/run-all-tests tidb-test=pr/1086 |
/run-all-tests |
1 similar comment
/run-all-tests |
/run-check_dev_2 |
/test-check_dev_2 |
/run-all-tests |
/run-all-tests |
What problem does this PR solve?
Issue Number: ref #18551
Problem Summary:
to support planner select index before pruning
What is changed and how it works?
What's Changed:
How it Works:
Related changes
Check List
Tests
Side effects
Release note
This change is