pingcap / pingcap/tidb

Allow TiFlash coprocessor only when `keep_order` is required

Open
#62,749 2 comments 0 reactions 2 assignees Claimed by @guo-shaoge View on GitHub
sig/planner type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement

https://docs.pingcap.com/tidb/stable/system-variables/#tidb_allow_tiflash_cop-new-in-v730
In TiDB 7.3.0, the variable `tidb_allow_tiflash_cop` is set to false by default. The original motivation for this change was that the planner might generate TiFlash coprocessor requests for simple table scans (with or without filters) instead of MPP tasks, which could lead to suboptimal performance.

However, coprocessor requests are still necessary when the `keep_order` property is required, as MPP execution cannot preserve row order. Therefore, a better approach might be to allow TiFlash coprocessor requests only when `keep_order` is true. With this behavior, the `tidb_allow_tiflash_cop` variable can remain enabled (true) without risking performance regressions.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.