Hi all,

I want to reduce the constant expression in sql, replacing them with a 
corresponding constant.

For instance I have a sql query :

SELECT a, b, c+(2+3) as d FROM Orders WHERE b > (1+4)


I want some planner rules can optimize this query to reduce the constant 
exprssions: 

SELECT a, b, c+5 as d FROM Orders WHERE b > 5


It seems that ReduceExpressionsRule is what I need, and I tried it many times 
but it didn’t work. 

Is the way I used wrong ? Or there is any exist rule to use, or I have to 
implement one myself ? 



- Jark Wu 

Reply via email to