planner: support a hint or var like `index-join-first` to indicate the planner to prefer `IndexJoin` over other joins
Open
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:
Contributor guide
Assessment
This issue has not been assessed yet.