pingcap / pingcap/tidb

planner: support a hint or var like `index-join-first` to indicate the planner to prefer `IndexJoin` over other joins

Open
#61,501 0 comments 1 reaction 1 assignee Claimed by @fixdb View on GitHub
report/customer sig/planner type/enhancement
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Enhancement
In some typical TP scenarios, for multi-way joins, the best plan should always use `IndexJoin` or `Apply`(`NestedLoopJoin`), but our optimizer sometimes might choose other join types due to inaccurate cost model or cardinality estimation.

We've met this problems multiple times, so it might be better to support a hint or variable like `index-join-first` to indicate the optimizer always choose `IndexJoin` if possible in such scenarios:

Image

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.