Skip to content

Conversation

@hawkingrei
Copy link
Member

@hawkingrei hawkingrei commented Oct 26, 2025

What problem does this PR solve?

Issue Number: close #64128

Problem Summary:

What changed and how does it work?

Image

In the solve of constant propagation, the slices of ExtractColumn will be converted into a map and deduplicated. Therefore, directly converting them into a map is better than converting them into slices.

Check List

Tests

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

before

BenchmarkTPCHQ3-8   	     924	   1159361 ns/op	 1739137 B/op	   23110 allocs/op

after

BenchmarkTPCHQ3-8   	     966	   1149071 ns/op	 1738760 B/op	   23045 allocs/op
  • 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 Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. sig/planner SIG: Planner and removed do-not-merge/needs-tests-checked labels Oct 26, 2025
@codecov
Copy link

codecov bot commented Oct 26, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.3994%. Comparing base (6da2997) to head (661b9a8).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #64121        +/-   ##
================================================
+ Coverage   72.7343%   73.3994%   +0.6651%     
================================================
  Files          1856       1857         +1     
  Lines        501939     502050       +111     
================================================
+ Hits         365082     368502      +3420     
+ Misses       114662     111504      -3158     
+ Partials      22195      22044       -151     
Flag Coverage Δ
integration 41.9357% <100.0000%> (?)
unit 72.5219% <100.0000%> (+0.2204%) ⬆️

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

Components Coverage Δ
dumpling 52.8700% <ø> (+0.1132%) ⬆️
parser ∅ <ø> (∅)
br 46.4105% <ø> (+0.0531%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hawkingrei hawkingrei changed the title *: reuse memory in the constant propagation *: extract column into map in the constant propagation Oct 27, 2025
@hawkingrei
Copy link
Member Author

/retest

s.insertCols(mp)
clear(mp)
}
PutUniqueIDToColumnMap(mp)
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe use defer to put mp back?

Copy link
Member Author

Choose a reason for hiding this comment

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

The lifecycle here is clear, and the optimization steps are very time-consuming. So we should put it into the pool immediately after it has been used up.

Copy link
Member Author

Choose a reason for hiding this comment

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

I refactor the code to use defer

Copy link
Contributor

@windtalker windtalker left a comment

Choose a reason for hiding this comment

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

lgtm

@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 27, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: windtalker
Once this PR has been reviewed and has the lgtm label, please assign henrybw for approval. For more information see the Code Review Process.
Please ensure that each of them provides their approval before proceeding.

The full list of commands accepted by this bot can be found 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 needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Oct 27, 2025
@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 27, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-10-27 08:35:37.331813299 +0000 UTC m=+1292843.409065859: ☑️ agreed by windtalker.

@mjonss
Copy link
Contributor

mjonss commented Oct 27, 2025

/cc @henrybw

@ti-chi-bot
Copy link

ti-chi-bot bot commented Oct 27, 2025

@mjonss: GitHub didn't allow me to request PR reviews from the following users: henrybw.

Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @henrybw

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-sigs/prow repository.

@hawkingrei
Copy link
Member Author

/retest

2 similar comments
@hawkingrei
Copy link
Member Author

/retest

@hawkingrei
Copy link
Member Author

/retest

Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
@hawkingrei
Copy link
Member Author

/retest

@hawkingrei
Copy link
Member Author

/retest

1 similar comment
@hawkingrei
Copy link
Member Author

/retest

@henrybw
Copy link
Contributor

henrybw commented Oct 28, 2025

/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 Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-1-more-lgtm Indicates a PR needs 1 more LGTM. release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unnecessary to extract column into slices when to constant propagation

4 participants