-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Conversation
…table_name columns
Hi @tangenta. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with 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. |
Codecov ReportAttention: Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more.
|
pkg/executor/infoschema_reader.go
Outdated
@@ -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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
switch scalar.FuncName.L { | ||
case ast.Lower: | ||
helper.pushedDownFuncs = make(map[string]func(string) string) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
/lgtm |
@joechenrh: adding LGTM is restricted to approvers and reviewers in OWNERS files. 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. |
[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 |
[LGTM Timeline notifier]Timeline:
|
/retest |
@tangenta: Cannot trigger testing until a trusted user reviews the PR and leaves an 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-sigs/prow repository. |
/retest |
@tangenta: Cannot trigger testing until a trusted user reviews the PR and leaves an 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-sigs/prow repository. |
What problem does this PR solve?
Issue Number: ref #50305
Problem Summary:
Previously, we only support pushing down LIKE pattern for
tidb_index_usage
andcolumns
.What changed and how does it work?
ListSchemas
andListTables
intoListSchemasAndTables
forsetDataFromIndexUsage
andsetDataForColumns
.hugeMemTableRetriever
according to previous point.upper()
andlower()
, now it is much flexible to support other functions.InfoSchemaTableNameExtractor
.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.