-
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
*: Chunkreuse try reuse chunk in operator #38607
Conversation
modified: distsql/select_result.go modified: executor/adapter.go modified: executor/admin.go modified: executor/aggregate.go modified: executor/builder.go modified: executor/coprocessor.go modified: executor/cte.go modified: executor/delete.go modified: executor/distsql.go modified: executor/executor.go modified: executor/explain.go modified: executor/index_lookup_hash_join.go modified: executor/index_lookup_join.go modified: executor/index_lookup_merge_join.go modified: executor/index_merge_reader.go modified: executor/insert_common.go modified: executor/join.go modified: executor/joiner.go modified: executor/merge_join.go modified: executor/parallel_apply.go modified: executor/pipelined_window.go modified: executor/projection.go modified: executor/select_into.go modified: executor/show.go modified: executor/shuffle.go modified: executor/sort.go modified: executor/union_scan.go modified: executor/update.go modified: executor/window.go modified: server/conn.go modified: sessionctx/variable/session.go modified: sessionctx/variable/sysvar.go modified: sessionctx/variable/tidb_vars.go modified: util/chunk/alloc.go modified: util/chunk/alloc_test.go modified: util/chunk/chunk.go
…into chunkreuse Conflicts: executor/adapter.go executor/aggregate.go executor/builder.go executor/coprocessor.go executor/distsql.go executor/executor.go executor/join.go executor/projection.go executor/union_scan.go executor/update.go sessionctx/variable/session.go util/chunk/alloc.go modified: executor/executor.go modified: executor/index_lookup_merge_join.go modified: sessionctx/variable/session.go
modified: executor/parallel_apply.go modified: sessionctx/variable/session.go modified: util/chunk/alloc.go modified: util/chunk/chunk.go
modified: executor/admin.go modified: executor/aggregate.go modified: executor/distsql.go modified: executor/executor.go modified: executor/index_lookup_hash_join.go modified: executor/index_lookup_join.go modified: executor/index_lookup_merge_join.go modified: executor/index_merge_reader.go modified: executor/join.go modified: executor/joiner.go modified: executor/pipelined_window.go modified: server/conn.go
modified: sessionctx/variable/sysvar.go modified: sessionctx/variable/tidb_vars.go modified: util/chunk/alloc.go
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
@keeplearning20221 Please fix the linter. |
modified: util/chunk/alloc.go modified: util/chunk/chunk.go
modified: util/chunk/chunk.go
modified: sessionctx/variable/tidb_vars.go
modified: executor/index_lookup_merge_join.go modified: util/chunk/alloc_test.go
modified: util/chunk/alloc_test.go
/run-build |
/run-unit-test |
/run-build |
modified: sessionctx/variable/session_test.go modified: util/chunk/alloc.go modified: util/chunk/alloc_test.go modified: util/chunk/chunk_test.go
modified: infoschema/tables_test.go modified: sessionctx/variable/BUILD.bazel modified: testkit/BUILD.bazel modified: tidb-server/BUILD.bazel
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.
Perhaps related regression tests and bechmark tests are needed as it would be enabled by default.
/build-release |
/release |
We can change to disable by default if we find anything wrong during test. |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 0ceee0d
|
/run-build |
/run-check_dev_2 |
/run-mysql-test |
/run-unit-test |
/run-check_dev_2 |
TiDB MergeCI notify✅ Well Done! New fixed [2] after this pr merged.
|
What problem does this PR solve?
Issue Number: close #38606
Problem Summary:
Every time chunk is used, it will be applied from the system, which affects the execution efficiency of tidb-server.
What is changed and how it works?
Cache previously applied chunks and columns in alloc.later, it will get chunk from cache first , if not enough then apply from system.
Alloc modified based on the alloc developed by tiancaiamao. It uses slices to manage chunks objects and columns objects. When used, they are taken out of free slices and placed in allocated slices.When the SQL execution is complete, put it back from the allocated slice back to the free slice.
Add configuration items
tidb_enable_reuse_chunk function switch
tidb_max_reuse_chunk Maximum number of cached chunks
tidb_max_reuse_column Maximum number of cached columns
Add read-only variable:
Last_sql_use_alloc Whether the previous sql uses chunk alloc
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.