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: make tablesample work under different partition prune modes #52405

Merged
merged 3 commits into from Apr 12, 2024

Conversation

tangenta
Copy link
Contributor

@tangenta tangenta commented Apr 8, 2024

What problem does this PR solve?

Issue Number: close #52282

Problem Summary:

When tidb_partition_prune_mode is static, TiDB uses a separate operator to union results from different partitions. But tablesample always collects samples from all partitions, the result may contains duplicated rows.

What changed and how does it work?

Pass physicalTableID to TableSampleExecutor, now it only collect samples from corresponding partitions.

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 do-not-merge/needs-triage-completed release-note-none size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 8, 2024
Copy link

tiprow bot commented Apr 8, 2024

Hi @tangenta. 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.

@tangenta
Copy link
Contributor Author

tangenta commented Apr 8, 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 8, 2024
Copy link

codecov bot commented Apr 8, 2024

Codecov Report

Merging #52405 (9bf93c5) into master (29ced7f) will increase coverage by 2.2620%.
Report is 51 commits behind head on master.
The diff coverage is 91.6666%.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #52405        +/-   ##
================================================
+ Coverage   74.1411%   76.4031%   +2.2620%     
================================================
  Files          1467       1493        +26     
  Lines        354227     449476     +95249     
================================================
+ Hits         262628     343414     +80786     
- Misses        72389      85252     +12863     
- Partials      19210      20810      +1600     
Flag Coverage Δ
integration 53.3055% <91.6666%> (?)
unit 72.4705% <55.5555%> (-0.4258%) ⬇️

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

Components Coverage Δ
dumpling 53.9957% <ø> (-2.3014%) ⬇️
parser ∅ <ø> (∅)
br 62.2344% <ø> (+19.8006%) ⬆️

Copy link

ti-chi-bot bot commented Apr 8, 2024

@qw4990: Your lgtm message is repeated, so it is ignored.

In response to this:

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.

@tangenta
Copy link
Contributor Author

tangenta commented Apr 8, 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 8, 2024
Copy link

ti-chi-bot bot commented Apr 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Defined2014, 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

Copy link

ti-chi-bot bot commented Apr 12, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-04-08 07:38:36.410270327 +0000 UTC m=+861577.937810873: ☑️ agreed by qw4990.
  • 2024-04-12 03:12:27.86262329 +0000 UTC m=+1191209.390163835: ☑️ agreed by Defined2014.

@tangenta
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Apr 12, 2024

@tangenta: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

@ti-chi-bot ti-chi-bot bot merged commit 98e8cec into pingcap:master Apr 12, 2024
25 checks passed
@ti-chi-bot
Copy link
Member

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

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-8.1 release-note-none 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.

return wrong results when accessing partition tables with tablesample
4 participants