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: collect all columns meta by sync load #53137

Merged
merged 3 commits into from May 14, 2024

Conversation

hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented May 9, 2024

What problem does this PR solve?

Issue Number: close #53141

Problem Summary:

What changed and how does it work?

In calculating cost, we need all columns' stats to get row size.

image

To get right result,so we need to load all stats when to sync load.

But here is a bug. ds.Columns has been pruned. it doesn't contain all columns.

image

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-linked-issue do-not-merge/needs-tests-checked release-note-none sig/planner SIG: Planner size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 9, 2024
Copy link

codecov bot commented May 9, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 74.5223%. Comparing base (4b91fee) to head (776fab4).
Report is 1 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #53137        +/-   ##
================================================
+ Coverage   74.4490%   74.5223%   +0.0733%     
================================================
  Files          1493       1493                
  Lines        356315     429407     +73092     
================================================
+ Hits         265273     320004     +54731     
- Misses        71770      89514     +17744     
- Partials      19272      19889       +617     
Flag Coverage Δ
integration 49.0489% <83.3333%> (?)
unit 71.2569% <83.3333%> (-1.9599%) ⬇️

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

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

@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. do-not-merge/needs-linked-issue do-not-merge/needs-tests-checked size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 9, 2024
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 13, 2024
@hawkingrei hawkingrei changed the title planner: collect all columns stats by sync load planner: collect all columns meta by sync load May 13, 2024
Copy link
Member

@hi-rustin hi-rustin left a comment

Choose a reason for hiding this comment

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

rest LGTM

pkg/planner/core/collect_column_stats_usage.go Outdated Show resolved Hide resolved
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Copy link
Member

@hi-rustin hi-rustin left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks! 👍

Copy link

ti-chi-bot bot commented May 14, 2024

[APPROVALNOTIFIER] This PR is APPROVED

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

Copy link

ti-chi-bot bot commented May 14, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-13 11:45:21.599122213 +0000 UTC m=+1480875.356257784: ☑️ agreed by winoros.
  • 2024-05-14 06:58:11.324428038 +0000 UTC m=+1550045.081563611: ☑️ agreed by hi-rustin.

@ti-chi-bot ti-chi-bot bot merged commit a2037fe into pingcap:master May 14, 2024
23 checks passed
@ti-chi-bot
Copy link
Member

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

@hawkingrei hawkingrei deleted the 0509 branch May 14, 2024 08:40
terry1purcell pushed a commit to terry1purcell/tidb that referenced this pull request May 17, 2024
ti-chi-bot pushed a commit to ti-chi-bot/tidb that referenced this pull request May 22, 2024
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.5: #53462.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-8.1 approved lgtm needs-cherry-pick-release-8.1 release-note-none sig/planner SIG: Planner size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

load all column stats by sync load
4 participants