pingcap / pingcap/tidb

Correlated subquery will not build index ranges when the it is contained by a scalar function

Open
#56,710 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

We support constructing index ranges with correlated columns. But only support the most simple case `col op cor_col`.

But we'll fail to do it when the correlated column is contained by a scalar function, like `col op cor_col` while they have different types. In this case the final expr will become `col op cast(cor_col)`, which will fail to construct index ranges.

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.