Re: RelFieldTrimmer misses optimization opportunity for always false condition

2020-08-11 Thread chunwei
Thanks for reporting this, Vladimir. You can file a JIRA for it. Best, Chuwnei On Wed, Aug 12, 2020 at 12:06 AM Julian Hyde wrote: > I’m not entirely sure why RelFieldTrimmer doesn’t touch the “*” case. > Perhaps because its main job is to trim fields, and so if there’s no field > trimming

Re: RelFieldTrimmer misses optimization opportunity for always false condition

2020-08-11 Thread Julian Hyde
I’m not entirely sure why RelFieldTrimmer doesn’t touch the “*” case. Perhaps because its main job is to trim fields, and so if there’s no field trimming to be done, it tries to do no harm. The main code responsible for pruning empty relational operators is PruneEmptyRules. I think you should

RelFieldTrimmer misses optimization opportunity for always false condition

2020-08-11 Thread Vladimir Ozerov
Hi colleagues, Consider the following query. If the RelFieldTrimmer is applied to this, then the expression is reduced to an empty LogicalValues: SELECT field FROM table WHERE TRUE IS FALSE However, the following query will not be simplified, leaving a table scan with "always false" filter: