Re: NOT IN vs. NOT EXISTS performance

2018-11-09 Thread Lincoln Swaine-Moore
Thanks, both! That's a very interesting thread. I was confident this was a subject that had been discussed--just wasn't sure where--so thank you for forwarding. I guess the big-picture summary is that NOT IN's definition introduces complexity (the nature of which I now understand better) that is

Re: NOT IN vs. NOT EXISTS performance

2018-11-09 Thread Merlin Moncure
On Thu, Nov 8, 2018 at 3:12 PM David Rowley wrote: > > On 9 November 2018 at 08:35, Lincoln Swaine-Moore > wrote: > > My primary question is: why is this approach only possible (for data too > > large for memory) when using NOT EXISTS, and not when using NOT IN? > > > > I understand that there is

Re: NOT IN vs. NOT EXISTS performance

2018-11-08 Thread David Rowley
On 9 November 2018 at 08:35, Lincoln Swaine-Moore wrote: > My primary question is: why is this approach only possible (for data too > large for memory) when using NOT EXISTS, and not when using NOT IN? > > I understand that there is a slight difference in the meaning of the two > expressions, in t

NOT IN vs. NOT EXISTS performance

2018-11-08 Thread Lincoln Swaine-Moore
Hi all, I've figured out how to solve the performance issues I've been encountering with a particular query, but I'm interested in better understanding the intuition behind why the better query is so much more performant. The query in question involves a NOT IN filter from a CTE: WITH temp as (