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: add CTEProducer that shared by all CTEExec #44643

Merged
merged 7 commits into from
Jun 19, 2023

Conversation

guo-shaoge
Copy link
Collaborator

@guo-shaoge guo-shaoge commented Jun 13, 2023

What problem does this PR solve?

Issue Number: close #44649

Problem Summary: As issue comment said: #44649 (comment)

What is changed and how it works?

Before: For different CTE references(a.k.a. CTEExec) that use one CTE definition. They will only have one PhysicalPlan of the CTE defition. But we will build CTE definition multiple time for each CTE references.

After: Add CTEProducer struct, it corresponsds to CTE defition and will only build once. These different CTEExec will read from the same CTEProducer.

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 do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. do-not-merge/needs-triage-completed and removed do-not-merge/needs-linked-issue labels Jun 13, 2023
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 13, 2023
@guo-shaoge guo-shaoge changed the title executor: use one executor tree for different cte references executor: always copy cte's seed/recursive physical plan when build executor Jun 13, 2023
@ti-chi-bot ti-chi-bot bot added needs-cherry-pick-release-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. 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. and removed do-not-merge/needs-triage-completed labels Jun 13, 2023
@guo-shaoge guo-shaoge changed the title executor: always copy cte's seed/recursive physical plan when build executor executor: copy cte's seed/recursive physical plan when build executor Jun 14, 2023
@guo-shaoge guo-shaoge changed the title executor: copy cte's seed/recursive physical plan when build executor executor: copy cte's seed and recursive physical plan when build executor Jun 14, 2023
@guo-shaoge guo-shaoge changed the title executor: copy cte's seed and recursive physical plan when build executor executor: copy cte's seed and recursive physical plans when build executor Jun 14, 2023
Signed-off-by: guo-shaoge <shaoge1994@163.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 Jun 15, 2023
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 15, 2023
Signed-off-by: guo-shaoge <shaoge1994@163.com>
Signed-off-by: guo-shaoge <shaoge1994@163.com>
@guo-shaoge guo-shaoge changed the title executor: copy cte's seed and recursive physical plans when build executor executor: add CTEProducer that shared by all same CTEExec Jun 15, 2023
@guo-shaoge guo-shaoge changed the title executor: add CTEProducer that shared by all same CTEExec executor: add CTEProducer that shared by all CTEExec Jun 15, 2023
@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Jun 19, 2023
@ti-chi-bot
Copy link

ti-chi-bot bot commented Jun 19, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-06-16 08:29:16.478690097 +0000 UTC m=+333552.893294161: ☑️ agreed by wshwsh12.
  • 2023-06-19 05:08:33.760658822 +0000 UTC m=+580710.175262899: ☑️ agreed by XuHuaiyu.

@guo-shaoge
Copy link
Collaborator Author

/test check-dev2

@guo-shaoge
Copy link
Collaborator Author

/test check_dev

@ti-chi-bot
Copy link

ti-chi-bot bot commented Jun 19, 2023

@guo-shaoge: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test build
  • /test canary-scan-security
  • /test check-dev
  • /test check-dev2
  • /test mysql-test
  • /test pingcap/tidb/canary_ghpr_unit_test
  • /test pull-integration-br-test
  • /test pull-integration-mysql-test
  • /test unit-test

Use /test all to run the following jobs that were automatically triggered:

  • pingcap/tidb/ghpr_build
  • pingcap/tidb/ghpr_check
  • pingcap/tidb/ghpr_check2
  • pingcap/tidb/ghpr_mysql_test
  • pingcap/tidb/ghpr_unit_test

In response to this:

/test check_dev

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.

@guo-shaoge
Copy link
Collaborator Author

/test check-dev

@ti-chi-bot ti-chi-bot bot merged commit cfef1b0 into pingcap:master Jun 19, 2023
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jun 19, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jun 19, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

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

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jun 19, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

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

@wshwsh12
Copy link
Contributor

/cherry-pick release-6.1-20230515-v6.1.6

@ti-chi-bot
Copy link
Member

@wshwsh12: new pull request created to branch release-6.1-20230515-v6.1.6: #44836.

In response to this:

/cherry-pick release-6.1-20230515-v6.1.6

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 ti-community-infra/tichi repository.

ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request Jun 20, 2023
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
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-5.4 Should cherry pick this PR to release-5.4 branch. needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple references of same CTE may got wrong result
4 participants