pingcap / tidb

TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://www.pingcap.com/tidb-serverless/
https://pingcap.com
Apache License 2.0
36.32k stars 5.72k forks source link

Optimizer: refactor outer to inner join conversion as a separate rule #53278

Closed ghazalfamilyusa closed 2 days ago

ghazalfamilyusa commented 2 weeks ago

Enhancement

Currently, the outer to inner join rewrite is part of the predicate push down. This is causing confusion and difficulty in extending of both rewrites. Also, the current implementation of outer to inner join rewrite has unnecessary special cases and error prone. Also, the unit test cases currently are very limited and we need more coverage of the scope.

Details

The enhancement will basically accomplish the following: