Skip to content

Conversation

AilinKid
Copy link
Contributor

@AilinKid AilinKid commented May 16, 2025

What problem does this PR solve?

Issue Number: ref #60106 close #60276

Problem Summary:

What changed and how does it work?

It inherits some stats from the index join inside underlying datasource, which is the problem we have been talking about --- some index join's inner side operator's est row count may be greater the underlying ds and this is because this operator didn't adjust it estimation according to the avgInnerCount as the ds does. So this pr is essentially to directly inherit and keep the alignment with the undelrying rowcount, as long as it is found to be the index join inside end. Also there are some tasks warnings collection work. Generally speaking, the tasks copy() and convertToRoot() basically cover most of the situations, but for some task new mannually, we need to manually inherit warnings. Here is a supplement.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

.
Signed-off-by: AilinKid <[email protected]>
@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. sig/planner SIG: Planner labels May 16, 2025
Copy link

tiprow bot commented May 16, 2025

Hi @AilinKid. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

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.

@@ -1215,7 +1215,7 @@ func buildDataSource2IndexScanByIndexJoinProp(
// here we don't need to construct physical index join here anymore, because we will encapsulate it bottom-up.
// chosenPath and lastColManager of indexJoinResult should be returned to the caller (seen by index join to keep
// index join aware of indexColLens and compareFilters).
completeIndexJoinFeedBackInfo(innerTask.(*CopTask), indexJoinResult, indexJoinResult.chosenRanges.Range(), keyOff2IdxOff)
completeIndexJoinFeedBackInfo(innerTask.(*CopTask), indexJoinResult, indexJoinResult.chosenRanges, keyOff2IdxOff)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just a param passing mistake made before. just fix it

.
Signed-off-by: AilinKid <[email protected]>
@@ -2157,6 +2157,13 @@ func tryToGetIndexJoin(p *logicalop.LogicalJoin, prop *property.PhysicalProperty
return filterIndexJoinBySessionVars(p.SCtx(), candidates), false
}

func enumerationContainIndexJoin(candidates []base.PhysicalPlan) bool {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used in next pr (the final one)

.
Signed-off-by: AilinKid <[email protected]>
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 16, 2025
@hawkingrei
Copy link
Member

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label May 16, 2025
Copy link

codecov bot commented May 16, 2025

Codecov Report

Attention: Patch coverage is 52.63158% with 45 lines in your changes missing coverage. Please review.

Project coverage is 73.6530%. Comparing base (cb04077) to head (04ba14d).
Report is 65 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #61148        +/-   ##
================================================
+ Coverage   73.1619%   73.6530%   +0.4910%     
================================================
  Files          1724       1724                
  Lines        477379     477684       +305     
================================================
+ Hits         349260     351829      +2569     
+ Misses       106687     104466      -2221     
+ Partials      21432      21389        -43     
Flag Coverage Δ
integration 42.5733% <36.8421%> (?)
unit 72.4894% <52.6315%> (+0.1098%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.7804% <ø> (ø)
parser ∅ <ø> (∅)
br 47.7686% <ø> (+0.0219%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

ti-chi-bot bot commented May 16, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hawkingrei, qw4990

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels May 16, 2025
Copy link

ti-chi-bot bot commented May 16, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-05-16 07:10:20.643599947 +0000 UTC m=+96586.899497346: ☑️ agreed by hawkingrei.
  • 2025-05-16 17:37:19.742116127 +0000 UTC m=+134205.998013527: ☑️ agreed by qw4990.

@ti-chi-bot ti-chi-bot bot merged commit 7419112 into pingcap:master May 16, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved index-join-refactor-epic lgtm ok-to-test Indicates a PR is ready to be tested. release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

some index join inner pattern(like aggregation or projection)'s estimation is wrong
3 participants