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

Support keepOrder = true for partition table in BatchPointGetExec #45702

Open
Defined2014 opened this issue Aug 1, 2023 · 0 comments
Open

Support keepOrder = true for partition table in BatchPointGetExec #45702

Defined2014 opened this issue Aug 1, 2023 · 0 comments
Assignees
Labels
component/tablepartition This issue is related to Table Partition of TiDB. type/enhancement The issue or PR belongs to an enhancement.

Comments

@Defined2014
Copy link
Contributor

Defined2014 commented Aug 1, 2023

Enhancement

To support keepOrder, we should support sort handles from different partition in func (e *BatchPointGetExec) initialize(ctx context.Context), like

if e.keepOrder {
slices.SortFunc(toFetchIndexKeys, func(i, j kv.Key) bool {
if e.desc {
return i.Cmp(j) > 0
}
return i.Cmp(j) < 0
})
}

and
slices.SortFunc(e.handles, less)

After support it, we could remove the codes below and update test cases.

// TODO: support keepOrder for partition table with dynamic pruning
if ds.TableInfo().GetPartitionInfo() != nil && ds.SCtx().GetSessionVars().StmtCtx.UseDynamicPruneMode {
return invalidTask
}

@Defined2014 Defined2014 added type/enhancement The issue or PR belongs to an enhancement. component/tablepartition This issue is related to Table Partition of TiDB. labels Aug 1, 2023
@mjonss mjonss self-assigned this Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/tablepartition This issue is related to Table Partition of TiDB. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

No branches or pull requests

2 participants