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

executor,planner: Relax projection column expression push down check conditions #52502

Merged
merged 10 commits into from Apr 15, 2024

Conversation

yibin87
Copy link
Contributor

@yibin87 yibin87 commented Apr 11, 2024

What problem does this PR solve?

Issue Number: close #52501

Problem Summary:

In #52143 , new projections might be added above join/selection operators, the output schema of projections may contain limit-supported data types. These data types are allowed for just reading without any calculations. For projection operators, column expression satisfy the rule, so relax it.

Besides, eliminate the MPP specific prunePhysicalColumns logic, since these cases are completely handled by #52143 already.

What changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
    TiFlash ci tests contain integration tests that covers the changes.
  • 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: yibin <huyibin@pingcap.com>
@ti-chi-bot ti-chi-bot bot added release-note-none sig/planner SIG: Planner size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 11, 2024
Copy link

tiprow bot commented Apr 11, 2024

Hi @yibin87. 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/test-infra repository.

@yibin87
Copy link
Contributor Author

yibin87 commented Apr 11, 2024

/cc @windtalker @SeaRise

@ti-chi-bot ti-chi-bot bot requested review from SeaRise and windtalker April 11, 2024 06:53
@yibin87 yibin87 changed the title executor: Relax projection column expression push down check conditions executor,planner: Relax projection column expression push down check conditions Apr 11, 2024
Signed-off-by: yibin <huyibin@pingcap.com>
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 11, 2024
Copy link

codecov bot commented Apr 11, 2024

Codecov Report

Merging #52502 (8001107) into master (7a85b01) will increase coverage by 2.6837%.
Report is 2 commits behind head on master.
The diff coverage is 90.9090%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #52502        +/-   ##
================================================
+ Coverage   70.7712%   73.4549%   +2.6837%     
================================================
  Files          1470       1470                
  Lines        408762     433648     +24886     
================================================
+ Hits         289286     318536     +29250     
+ Misses       100177      95498      -4679     
- Partials      19299      19614       +315     
Flag Coverage Δ
integration 46.4732% <72.7272%> (?)

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

Components Coverage Δ
dumpling 53.9957% <ø> (-2.3014%) ⬇️
parser ∅ <ø> (∅)
br 41.3894% <ø> (-1.2546%) ⬇️

Signed-off-by: yibin <huyibin@pingcap.com>
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 13, 2024
Signed-off-by: yibin <huyibin@pingcap.com>
Copy link
Contributor

@windtalker windtalker left a comment

Choose a reason for hiding this comment

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

And add some tests?

// some cases from update optimize will require avoiding projection elimination.
// see comments ahead of call of DoOptimize in function of buildUpdate().
err := prunePhysicalColumns(sctx, plan)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is removed because afte #52143, it is useless?

Copy link
Contributor Author

@yibin87 yibin87 Apr 15, 2024

Choose a reason for hiding this comment

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

Yes

@yibin87
Copy link
Contributor Author

yibin87 commented Apr 15, 2024

And add some tests?

Will add it

Signed-off-by: yibin <huyibin@pingcap.com>
@yibin87
Copy link
Contributor Author

yibin87 commented Apr 15, 2024

And add some tests?

Will add it

Done

@yibin87 yibin87 requested a review from windtalker April 15, 2024 01:49
@yibin87
Copy link
Contributor Author

yibin87 commented Apr 15, 2024

/cc @winoros

@ti-chi-bot ti-chi-bot bot requested a review from winoros April 15, 2024 02:18
Copy link
Contributor

@windtalker windtalker 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
Contributor

@SeaRise SeaRise left a comment

Choose a reason for hiding this comment

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

lgtm

pkg/expression/expr_to_pb.go Outdated Show resolved Hide resolved
Copy link

ti-chi-bot bot commented Apr 15, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-04-15 02:29:14.937644202 +0000 UTC m=+218774.048690650: ☑️ agreed by windtalker.
  • 2024-04-15 03:39:52.932232533 +0000 UTC m=+223012.043278979: ☑️ agreed by SeaRise.

@SeaRise
Copy link
Contributor

SeaRise commented Apr 15, 2024

/hold

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 15, 2024
@SeaRise
Copy link
Contributor

SeaRise commented Apr 15, 2024

comment /unhold to merge pr.

Co-authored-by: SeaRise <hhssearise@foxmail.com>
@yibin87
Copy link
Contributor Author

yibin87 commented Apr 15, 2024

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 15, 2024
Signed-off-by: yibin <huyibin@pingcap.com>
@ti-chi-bot ti-chi-bot bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 15, 2024
Copy link

ti-chi-bot bot commented Apr 15, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: SeaRise, windtalker, winoros

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 the approved label Apr 15, 2024
@ti-chi-bot ti-chi-bot bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 15, 2024
Signed-off-by: yibin <huyibin@pingcap.com>
Signed-off-by: yibin <huyibin@pingcap.com>
@ti-chi-bot ti-chi-bot bot merged commit 3d82fc5 into pingcap:master Apr 15, 2024
21 checks passed
3AceShowHand pushed a commit to 3AceShowHand/tidb that referenced this pull request Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none sig/planner SIG: Planner size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Relax PhysicalProjection column expression push down check condition
4 participants