A simple example is converting *SELECT a, b FROM t WHERE c = 1 UNION ALL SELECT a, b FROM t WHERE c = 2 *to *SELECT a, b FROM t WHERE c in (1, 2)*
Yanjing Wang <[email protected]> 于2022年1月19日周三 18:35写道: > Hi, community > > Here I recommend a new rule for converting UNION ALL sub plan to a single > input with an OR filter, the following is its conversion diagram. > [image: UnionAllToOrRule.jpg] > > The conversion prerequisites are > 1. left filter range has no intersection with right filter range. > 2. Project and Input Sub Tree must be identical. > > The rule will be used when Input Sub Tree is a computing-intensive or > large IO operation. > > I don't know whether the community supports it or not, any suggestions > will be appreciated. > > >
