Skip to content
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

planner: fix the case that projection prunes all columns | tidb-test=pr/2367 #54650

Merged
merged 4 commits into from
Jul 19, 2024

Conversation

winoros
Copy link
Member

@winoros winoros commented Jul 16, 2024

What problem does this PR solve?

Issue Number: close #54648

Problem Summary:

What changed and how does it work?

After #54609, limit and projection may still output no columns so its parent executor will treat its output as empty since there is no column as output.

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

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. do-not-merge/needs-triage-completed sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed do-not-merge/needs-triage-completed labels Jul 16, 2024
@qw4990 qw4990 added needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. labels Jul 16, 2024
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Jul 16, 2024
@qw4990
Copy link
Contributor

qw4990 commented Jul 16, 2024

/retest

Copy link

codecov bot commented Jul 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.5252%. Comparing base (ac92026) to head (0b176d8).
Report is 40 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #54650         +/-   ##
=================================================
- Coverage   72.8656%   56.5252%   -16.3405%     
=================================================
  Files          1551       1674        +123     
  Lines        436701     618110     +181409     
=================================================
+ Hits         318205     349388      +31183     
- Misses        98995     245337     +146342     
- Partials      19501      23385       +3884     
Flag Coverage Δ
integration 37.3613% <100.0000%> (?)
unit 71.9641% <100.0000%> (+0.0703%) ⬆️

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

Components Coverage Δ
dumpling 52.9656% <ø> (ø)
parser ∅ <ø> (∅)
br 52.4874% <ø> (+6.6234%) ⬆️

@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 18, 2024
@winoros winoros changed the title planner: fix the case that projection prunes all columns planner: fix the case that projection prunes all columns | tidb-test=pr/2367 Jul 18, 2024
@winoros
Copy link
Member Author

winoros commented Jul 19, 2024

/retest

2 similar comments
@winoros
Copy link
Member Author

winoros commented Jul 19, 2024

/retest

@winoros
Copy link
Member Author

winoros commented Jul 19, 2024

/retest

@winoros winoros removed needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. needs-cherry-pick-release-8.1 Should cherry pick this PR to release-8.1 branch. labels Jul 19, 2024
" │ └─Selection 8000.00 mpp[tiflash] gt(mul(test.t1.c1, test.t1.c1), plus(test.t1.c2, 10))",
" │ └─TableFullScan 10000.00 mpp[tiflash] table:ta pushed down filter:empty, keep order:false, stats:pseudo",
" └─TableFullScan(Probe) 10000.00 mpp[tiflash] table:tb keep order:false, stats:pseudo"
" └─Projection 80000000.00 mpp[tiflash] Column#8",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is there an extra projection here?

Copy link
Member Author

Choose a reason for hiding this comment

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

The join of the tiflash side doesn't support inline projection in itself. So we need to add the extra proj when the inline projection happens

Copy link
Member Author

Choose a reason for hiding this comment

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

And before this pr, tiflash side doesn't prune any column for the join. It's actually optimizing the join's output.

Copy link
Contributor

@elsa0520 elsa0520 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

ti-chi-bot bot commented Jul 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: elsa0520, 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 Jul 19, 2024
Copy link

ti-chi-bot bot commented Jul 19, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-07-16 03:14:55.238228753 +0000 UTC m=+323717.229170221: ☑️ agreed by qw4990.
  • 2024-07-19 06:01:57.401922303 +0000 UTC m=+592939.392863772: ☑️ agreed by elsa0520.

@winoros
Copy link
Member Author

winoros commented Jul 19, 2024

/retest

1 similar comment
@winoros
Copy link
Member Author

winoros commented Jul 19, 2024

/retest

@ti-chi-bot ti-chi-bot bot merged commit 8471e8a into pingcap:master Jul 19, 2024
23 checks passed
@winoros winoros deleted the 54648 branch July 19, 2024 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Limit operator would incorrectly discard result set
4 participants