pingcap / pingcap/tidb

Enable the index join for it whose probe side has a aggregate

Open
#44,008 0 comments 0 reactions 0 assignees View on GitHub
sig/planner type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement
![image](https://github.com/pingcap/tidb/assets/15825830/649a3d52-e24e-47e8-b2d2-14eb855eceac)

From the pic, the correlated column propagation can make the table scan as an index scan, while we disable the index join choice for this kind of case.

![image](https://github.com/pingcap/tidb/assets/15825830/295c6151-48d3-4ea2-bda1-f27571d62acf)

Workaround: an interesting workaround for this is adding a LIMIT 1000000000 in the probe side above the agg operator, the cost tradeoff may choose the indexRangeScan since LIMIT itself can have a quick close callback.

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.