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: push down LIKE patterns for some infoschema readers #55844

Merged
merged 8 commits into from
Sep 23, 2024

Conversation

tangenta
Copy link
Contributor

@tangenta tangenta commented Sep 4, 2024

What problem does this PR solve?

Issue Number: ref #50305

Problem Summary:

Previously, we only support pushing down LIKE pattern for tidb_index_usage and columns.

What changed and how does it work?

  • Support pushing down LIKE for other infoschema tables.
  • Merge ListSchemas and ListTables into ListSchemasAndTables for setDataFromIndexUsage and setDataForColumns.
  • Refactor hugeMemTableRetriever according to previous point.
  • Refactor pushed down mechanism for upper() and lower(), now it is much flexible to support other functions.
  • Remove InfoSchemaTableNameExtractor.

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 Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 4, 2024
Copy link

tiprow bot commented Sep 4, 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-sigs/prow repository.

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 93.24895% with 16 lines in your changes missing coverage. Please review.

Project coverage is 57.3350%. Comparing base (70a26f8) to head (b78dc97).
Report is 30 commits behind head on master.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #55844         +/-   ##
=================================================
- Coverage   72.9579%   57.3350%   -15.6230%     
=================================================
  Files          1611       1760        +149     
  Lines        447514     643427     +195913     
=================================================
+ Hits         326497     368909      +42412     
- Misses       100924     250987     +150063     
- Partials      20093      23531       +3438     
Flag Coverage Δ
integration 38.5859% <88.6877%> (?)
unit 73.4657% <91.8552%> (+1.3985%) ⬆️

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

Components Coverage Δ
dumpling 53.1514% <ø> (+0.1947%) ⬆️
parser ∅ <ø> (∅)
br 52.8257% <ø> (+7.0371%) ⬆️

@@ -927,7 +927,12 @@ func (e *hugeMemTableRetriever) retrieve(ctx context.Context, sctx sessionctx.Co

if !e.initialized {
e.is = sessiontxn.GetTxnManager(sctx).GetTxnInfoSchema()
e.dbs = e.extractor.ListSchemas(e.is)
dbs, tbls, err := e.extractor.ListSchemasAndTables(ctx, e.is)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the original design is to reduce the memory usage as much as possible. I'm not sure whether this will be a potential problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we can add a streaming interface for SchemaTableInfos to solve this completely.. Let me revert this change for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@CbcWestwolf CbcWestwolf self-requested a review September 6, 2024 01:47
}
switch scalar.FuncName.L {
case ast.Lower:
helper.pushedDownFuncs = make(map[string]func(string) string)
Copy link
Contributor

Choose a reason for hiding this comment

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

pushedDownFuncs is created each time setColumnPushedDownFn called?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I reduce the number of times to call setColumnPushedDownFn in this commit

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Sep 20, 2024
@joechenrh
Copy link
Contributor

/lgtm

Copy link

ti-chi-bot bot commented Sep 23, 2024

@joechenrh: adding LGTM is restricted to approvers and reviewers in OWNERS files.

In response to this:

/lgtm

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.

Copy link

ti-chi-bot bot commented Sep 23, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CbcWestwolf, hawkingrei, joechenrh

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

@ti-chi-bot ti-chi-bot bot added approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Sep 23, 2024
Copy link

ti-chi-bot bot commented Sep 23, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-09-20 07:17:11.759911315 +0000 UTC m=+1204701.500335255: ☑️ agreed by CbcWestwolf.
  • 2024-09-23 07:12:20.688309349 +0000 UTC m=+1463610.428733295: ☑️ agreed by hawkingrei.

@tangenta
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Sep 23, 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-sigs/prow repository.

@tangenta
Copy link
Contributor Author

/retest

Copy link

tiprow bot commented Sep 23, 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-sigs/prow repository.

@ti-chi-bot ti-chi-bot bot merged commit 8c132db into pingcap:master Sep 23, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner 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.

4 participants