help wantedsig/plannertype/feature-request
Description
Feature Request
In optimizer, it will replace a forever-empty table (like table scan with a constant false) with a "dual" table. This opt can save the rpc calls to TiKV or TiFlash engine. But this opt still miss some cases, there are two opts that're worthy to do:
- inner/semi join with dual table. In this case, we can replace inner join with dual table 'cause the result of join is empty too. Moreover, it can save the i/o scan greatly.
- union all/outer join with dual. In the mpp settings, an operator involved with dual table will block pushing down. Some operators that can run on TiFlash would have to run on TiDB. We have optimize the union all cases, but more need to be done.
Besides, TiFlash should also need to support dual in order to solve corner cases, such as outer join dual tables.