Re: Interesting Query Performance Question

From: David W Noon <dwnoon(at)ntlworld(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Interesting Query Performance Question
Date: 2010-11-06 16:53:54
Message-ID: 20101106165354.67ed9532@karnak.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Sat, 06 Nov 2010 11:59:48 -0400, Tom Lane wrote about Re: [ADMIN]
Interesting Query Performance Question:

>In general, NOT IN is hard to optimize because of its weird behavior
>for NULLs. I'd suggest looking into converting the query to use an
>EXISTS instead.

I have know about that issue for some years, so I always use a column
that has been declared NOT NULL for the sub-query. Does PostgreSQL not
use that property to bypass the vagaries of NULL in an IN predicate?
--
Regards,

Dave [RLU #314465]
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
dwnoon(at)ntlworld(dot)com (David W Noon)
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2010-11-06 17:12:18 Re: Interesting Query Performance Question
Previous Message Tom Lane 2010-11-06 15:59:48 Re: Interesting Query Performance Question