pingcap / pingcap/tidb

support extract the unrelated predication from the subquery

Open
#38,186 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
Support rewrite the query `select * from t1 where t1.a in (select aggregation(xxx) from t2 where t1.b > 6)` to `select * from t1 where t1.b > 6 and t1.a in (select aggregation(xxx) from t2)`. By the way, in some corner cases, the rewrite is wrong. For example, if the `aggregation(xxx)` is `count(1)` which can generate the result although the input is empty.

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.