Hello, all~
  I am writing an RelOptRule that is for CommonSubExpressions. Here is an
example that I completed.
    sql:  `select sal, sal * 12, sal * 3, sal * 12 + sal * 3 from emp`
    planBefore: ```LogicalProject(SAL=[$5], EXPR$1=[*($5, 12)],
EXPR$2=[*($5, 3)], EXPR$3=[+(*($5, 12), *($5, 3))])
  LogicalTableScan(table=[[CATALOG, SALES, EMP]])```
    planAfter: ```LogicalProject(SAL=[$0], EXPR$1=[$1], EXPR$2=[$2],
EXPR$3=[+($1, $2)])
 LogicalProject(SAL=[$5], CSE$0=[*($5, 12)], CSE$1=[*($5, 3)])
   LogicalTableScan(table=[[CATALOG, SALES, EMP]])```
  I found a RelOptRule that is named as CommonRelSubExprRule, but it is
abstract. I wonder if anyone has implemented it? Is it the same as what I
am doing?
  Thanks very much~

Reply via email to