planner: Remove an unused return value from cardinality.Selectivity.#65900
Conversation
|
Hi @wddevries. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/lgtm |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #65900 +/- ##
================================================
+ Coverage 77.7927% 77.8380% +0.0453%
================================================
Files 2001 1923 -78
Lines 545191 536347 -8844
================================================
- Hits 424119 417482 -6637
+ Misses 119410 118835 -575
+ Partials 1662 30 -1632
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
/retest |
|
@wddevries: PRs from untrusted users cannot be marked as trusted with DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/test unit-test |
|
@wddevries: PRs from untrusted users cannot be marked as trusted with DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
[LGTM Timeline notifier]Timeline:
|
There was a problem hiding this comment.
Pull request overview
This PR simplifies the planner/cardinality.Selectivity API by removing its unused second return value and updates all call sites accordingly.
Changes:
- Change
cardinality.Selectivityto return only(float64, error)instead of(float64, []*StatsNode, error). - Update all planner call sites to match the new signature.
- Update benchmarks/tests that called
Selectivityto use the new signature.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/planner/cardinality/selectivity.go | Removes the unused []*StatsNode return value from Selectivity and adjusts internal returns accordingly. |
| pkg/planner/cardinality/selectivity_test.go | Updates benchmark/tests to use the new (float64, error) signature. |
| pkg/planner/core/stats.go | Updates selectivity derivation call sites to the new signature. |
| pkg/planner/core/exhaust_physical_plans.go | Updates selectivity estimation calls used during task construction. |
| pkg/planner/core/find_best_task.go | Updates selectivity estimation calls during plan construction. |
| pkg/planner/core/indexmerge_path.go | Updates selectivity call for index-merge AND path estimation. |
| pkg/planner/core/indexmerge_unfinished_path.go | Updates selectivity call for index-merge OR path estimation. |
| pkg/planner/core/operator/physicalop/physical_table_scan.go | Updates selectivity call used for pushed filter estimation. |
| pkg/planner/core/operator/physicalop/task.go | Updates selectivity call used for root task condition handling. |
| pkg/planner/core/operator/physicalop/task_base.go | Updates selectivity call used when converting MPP task to root task. |
| pkg/planner/core/operator/physicalop/tiflash_predicate_push_down.go | Updates selectivity calls used for TiFlash predicate pushdown heuristics. |
Comments suppressed due to low confidence (1)
pkg/planner/core/stats.go:537
- The commented-out block below still references
nodesfromcardinality.Selectivity, butSelectivityno longer returns stats nodes. Please update/remove that TODO snippet (or adjust it to the new API) to avoid leaving stale, non-actionable guidance in the code.
selectivity, err := cardinality.Selectivity(ds.SCtx(), ds.TableStats.HistColl, conds, filledPaths)
if err != nil {
logutil.BgLogger().Debug("something wrong happened, use the default selectivity", zap.Error(err))
selectivity = cost.SelectionFactor
}
|
/retest-required |
|
@terry1purcell: PRs from untrusted users cannot be marked as trusted with DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
|
/retest-required |
|
/retest |
|
/retest-required |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hawkingrei, lance6716, terry1purcell The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
|
/retest |
What problem does this PR solve?
Issue Number: close #65899
Problem Summary:
What changed and how does it work?
This pull request removes the second unused return value in cardinality.Selectivity.
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.