Re: About reducing EXISTS sublink

2020-05-25 Thread Richard Guo
On Fri, May 22, 2020 at 10:59 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Friday, May 22, 2020, Richard Guo wrote: > >> Hi hackers, >> >> For EXISTS SubLink, in some cases the subquery can be reduced to >> constant TRUE or FALSE, based on the knowledge that it's being used in >

Re: About reducing EXISTS sublink

2020-05-22 Thread David G. Johnston
On Friday, May 22, 2020, Richard Guo wrote: > Hi hackers, > > For EXISTS SubLink, in some cases the subquery can be reduced to > constant TRUE or FALSE, based on the knowledge that it's being used in > EXISTS(). One such case is when the subquery has aggregates without > GROUP BY or HAVING, and w

About reducing EXISTS sublink

2020-05-22 Thread Richard Guo
Hi hackers, For EXISTS SubLink, in some cases the subquery can be reduced to constant TRUE or FALSE, based on the knowledge that it's being used in EXISTS(). One such case is when the subquery has aggregates without GROUP BY or HAVING, and we know its result is exactly one row, unless that row is