tidb icon indicating copy to clipboard operation
tidb copied to clipboard

planner: support push part of order property down to the partition table

Open winoros opened this issue 2 years ago • 4 comments

What problem does this PR solve?

Issue Number: ref #26166 (a quick solution)

Problem Summary:

The partition table shields the partition information in the execution phase. So we cannot convert the order by index limit x to LIMIT with the order property pushed to the index kv.

What is changed and how it works?

This time we don't change the codes of the execution. So we cannot push the full order property down to the index kv. We just change the plan from TopN(TiDB)->Reader(TiDB)->TopN(TiKV)->ScanKV(TiKV, no order) to TopN(TiDB)->Reader(TiDB)->Limit(TiKV)->ScanKV(TiKV, in order).

Check List

Tests

  • [x] 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.

push part of the order property down to the TiKV.

winoros avatar Jul 11 '22 15:07 winoros

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • AilinKid
  • fixdb

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment. After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Reviewer can indicate their review by submitting an approval review. Reviewer can cancel approval by submitting a request changes review.

ti-chi-bot avatar Jul 11 '22 15:07 ti-chi-bot

Code Coverage Details: https://codecov.io/github/pingcap/tidb/commit/27324cbb5e663b42207d456b6b59dca30ab37351

sre-bot avatar Jul 13 '22 12:07 sre-bot

This PR may also fix https://github.com/pingcap/tidb/issues/36536.

jackysp avatar Jul 28 '22 08:07 jackysp

/run-e2e-test

xuyifangreeneyes avatar Aug 30 '22 08:08 xuyifangreeneyes

/run-e2e-test

xuyifangreeneyes avatar Aug 30 '22 08:08 xuyifangreeneyes

/run-e2e-test

xuyifangreeneyes avatar Aug 30 '22 08:08 xuyifangreeneyes

/merge

AilinKid avatar Nov 29 '22 03:11 AilinKid

This pull request has been accepted and is ready to merge.

Commit hash: 953273f9f50d31c6e2d61f903c8017ff5dd8a051

ti-chi-bot avatar Nov 29 '22 03:11 ti-chi-bot

TiDB MergeCI notify

🔴 Bad News! New failing [1] after this pr merged. These new failed integration tests seem to be caused by the current PR, please try to fix these new failed integration tests, thanks!

CI Name Result Duration Compare with Parent commit
idc-jenkins-ci-tidb/integration-common-test 🟥 failed 1, success 16, total 17 30 min New failing
idc-jenkins-ci-tidb/sqllogic-test-2 ✅ all 28 tests passed 6 min 28 sec Fixed
idc-jenkins-ci/integration-cdc-test 🟢 all 40 tests passed 20 min Existing passed
idc-jenkins-ci-tidb/common-test 🟢 all 11 tests passed 11 min Existing passed
idc-jenkins-ci-tidb/integration-ddl-test 🟢 all 6 tests passed 6 min 19 sec Existing passed
idc-jenkins-ci-tidb/mybatis-test 🟢 all 1 tests passed 6 min 9 sec Existing passed
idc-jenkins-ci-tidb/sqllogic-test-1 🟢 all 26 tests passed 5 min 50 sec Existing passed
idc-jenkins-ci-tidb/tics-test 🟢 all 1 tests passed 5 min 30 sec Existing passed
idc-jenkins-ci-tidb/integration-compatibility-test 🟢 all 1 tests passed 3 min 28 sec Existing passed
idc-jenkins-ci-tidb/plugin-test 🟢 build success, plugin test success 4min Existing passed

sre-bot avatar Nov 29 '22 06:11 sre-bot