copr: support common handle for index_lookup_executor#19159
copr: support common handle for index_lookup_executor#19159ti-chi-bot[bot] merged 1 commit intotikv:masterfrom
Conversation
|
Hi @lcwangchao. Thanks for your PR. I'm waiting for a tikv member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
There was a problem hiding this comment.
Pull request overview
This PR adds support for common handles in the index lookup executor, enabling TiKV to handle tables with composite primary keys during index scan and lookup operations. Previously, the index lookup executor only supported integer handles (single-column primary keys).
Key Changes:
- Introduced
CommonHandletype alongside existingIntHandleto support composite primary keys - Added
extra_common_handle_keysfield toLazyBatchColumnVecfor passing handle data between executors - Refactored
RowHandle::from_lazy_batch_column_vec()to process multiple rows at once
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| components/tidb_query_datatype/src/codec/batch/lazy_column_vec.rs | Added extra_common_handle_keys field to store common handle keys for passing between executors |
| components/tidb_query_datatype/src/codec/table.rs | Refactored RowHandle trait to process batches; added CommonHandle implementation; renamed encode_common_handle_for_test to encode_common_handle for production use |
| components/tidb_query_executors/src/index_scan_executor.rs | Added fill_extra_common_handle_key parameter to populate common handle keys during index scans |
| components/tidb_query_executors/src/index_lookup_executor.rs | Refactored to use generic Handle type parameter and process handles in batches |
| components/tidb_query_executors/src/runner.rs | Added is_executor_under_parent_tp() to detect executor hierarchy; updated builder to choose between IntHandle and CommonHandle based on table schema |
| components/tidb_query_executors/src/projection_executor.rs | Added error handling to reject queries with common handle keys (not yet supported) |
| components/tidb_query_executors/src/util/top_n_heap.rs | Added logic to copy common handle keys when building TopN results |
| components/tidb_query_executors/src/table_scan_executor.rs | Updated test utilities to use renamed encode_common_handle function |
| tests/benches/coprocessor_executors/index_scan/util.rs | Updated test executor creation to include new fill_extra_common_handle_key parameter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bcdc47e to
9311a16
Compare
9311a16 to
b08d03c
Compare
|
/ok-to-test |
|
@lcwangchao Please fix the lint error |
Signed-off-by: Chao Wang <cclcwangchao@hotmail.com>
b08d03c to
3653123
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cfzjywxk, you06 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
close tikv#19158 copr: support common handle for index_lookup_executor Signed-off-by: Chao Wang <cclcwangchao@hotmail.com>
…ikv#4088) * copr: support common handle for index_lookup_executor (tikv#19159) close tikv#19158 copr: support common handle for index_lookup_executor Signed-off-by: Chao Wang <cclcwangchao@hotmail.com> * copr: fix TopN can not return the right extra common handle keys (tikv#19173) ref tikv#18736, close pingcap/tidb#64866 - Fix TopN can not return the right extra common handle keys - Also make BatchProjectionExecutor to support extra common handle keys - Added more tests to test extra common handle keys Signed-off-by: Chao Wang <cclcwangchao@hotmail.com> * address comment Signed-off-by: crazycs520 <crazycs520@gmail.com> --------- Signed-off-by: Chao Wang <cclcwangchao@hotmail.com> Signed-off-by: crazycs520 <crazycs520@gmail.com> Co-authored-by: Chao Wang <cclcwangchao@hotmail.com>
What is changed and how it works?
Issue Number: Close #19158
What's Changed:
Related changes
pingcap/docs/pingcap/docs-cn:Check List
Tests
Side effects
Release note