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, executor: fix the logic for inline projection of executors #45158

Merged
merged 8 commits into from
Jul 12, 2023

Conversation

winoros
Copy link
Member

@winoros winoros commented Jul 4, 2023

What problem does this PR solve?

Issue Number: close #45112

Problem Summary:

What is changed and how it works?

The Physical Projection Elimination permits the case that the parent plan has a column which cannot be found by the child(ren).

The only thing we can rely on during the execution phase is the Column.Index.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 4, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 4, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 4, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 4, 2023
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 5, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 5, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 5, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 5, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 5, 2023
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 5, 2023
@winoros winoros force-pushed the fix-for-inline-proj-of-executors branch from 97d979a to e7987f1 Compare July 5, 2023 16:48
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 5, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 5, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 5, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 5, 2023
@winoros winoros force-pushed the fix-for-inline-proj-of-executors branch from e7987f1 to 95592dc Compare July 5, 2023 16:56
@winoros winoros force-pushed the fix-for-inline-proj-of-executors branch from 95592dc to 0a2bcdd Compare July 5, 2023 17:01
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 5, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 5, 2023
@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 5, 2023
@winoros
Copy link
Member Author

winoros commented Jul 12, 2023

/retest

@ti-chi-bot ti-chi-bot bot deleted a comment from ti-chi-bot Jul 12, 2023
@winoros
Copy link
Member Author

winoros commented Jul 12, 2023

/retest

@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. labels Jul 12, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jul 12, 2023

@winoros: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-br-integration-test 0a27608 link true /test pull-br-integration-test

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@winoros
Copy link
Member Author

winoros commented Jul 12, 2023

/retest

@ti-chi-bot
Copy link

ti-chi-bot bot commented Jul 12, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: elsa0520, fixdb, 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 the approved label Jul 12, 2023
@ti-chi-bot ti-chi-bot bot merged commit a84c1e8 into pingcap:master Jul 12, 2023
@winoros winoros deleted the fix-for-inline-proj-of-executors branch July 12, 2023 11:02
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-6.5: #45332.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jul 12, 2023
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #45333.

p.SetChildren(subPlan)
}
// The limit missed its output cols via the protobuf.
// We need to add it back and do a ResolveIndicies for the later inline projection.
Copy link
Contributor

Choose a reason for hiding this comment

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

limit schema will not always like what its children are, like its children are projection, and it may have been eliminated

shallowColSlice := make([]*expression.Column, p.schema.Len())
copy(shallowColSlice, p.schema.Columns)
p.schema = expression.NewSchema(shallowColSlice...)
for i := 0; i < colsNeedResolving; i++ {
Copy link
Contributor

Choose a reason for hiding this comment

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

the only thing we can trust is the column.Index
while there will be some same cols ref to single one problems

Copy link
Contributor

Choose a reason for hiding this comment

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

see #45831

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm needs-cherry-pick-release-6.5 Should cherry pick this PR to release-6.5 branch. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Got index out of range error for subquery
6 participants