Re: RE:Re: BUG #7556 addition info

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: l1t(at)tom(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org, ringerc(at)ringerc(dot)id(dot)au
Subject: Re: RE:Re: BUG #7556 addition info
Date: 2012-10-03 17:58:59
Message-ID: 18047.1349287139@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

l1t(at)tom(dot)com writes:
> I think the id columns of table a and b are not null, so the query of "not in" and "not exists" are equal,they should use similar plans.

NOT IN and NOT EXISTS are *not* equivalent. Per SQL standard, NOT IN
has different (and usually not very desirable) behavior with NULL
values. The spec-mandated behavior makes it a lot harder to optimize
nicely --- and since you usually don't want what it does anyway, we
haven't tried hard.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message bryan.love 2012-10-03 20:36:43 BUG #7583: Problem using INHERITS and LIKE
Previous Message Alvaro Herrera 2012-10-03 15:55:28 Re: BUG #7578: Not able to drop user if S/he has permission on tablespace