pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #5755: Query Optimzer Bug
3+ messages / 3 participants
[nested] [flat]

* BUG #5755: Query Optimzer Bug
@ 2010-11-16 22:39  Elliott Groszek <elliott.groszek@navy.mil>
  0 siblings, 1 reply; 3+ messages in thread

From: Elliott Groszek @ 2010-11-16 22:39 UTC (permalink / raw)
  To: pgsql-bugs


The following bug has been logged online:

Bug reference:      5755
Logged by:          Elliott Groszek
Email address:      elliott.groszek@navy.mil
PostgreSQL version: 8.4.4
Operating system:   RedHat
Description:        Query Optimzer Bug
Details: 

The following SQL statements produce different query plans even though
"phone" is not reference in the SQL!

explain update customer set login_name =
(select "NESSOuserName" from person,phone
where person.cac_cert=customer.cac_cert);


explain update customer set login_name =
(select "NESSOuserName" from person
where person.cac_cert=customer.cac_cert);

Please advise,  Elliott



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #5755: Query Optimzer Bug
@ 2010-11-17 16:05  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Elliott Groszek <elliott.groszek@navy.mil>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2010-11-17 16:05 UTC (permalink / raw)
  To: Elliott Groszek <elliott.groszek@navy.mil>; +Cc: pgsql-bugs

"Elliott Groszek" <elliott.groszek@navy.mil> writes:
> The following SQL statements produce different query plans even though
> "phone" is not reference in the SQL!

> explain update customer set login_name =
> (select "NESSOuserName" from person,phone
> where person.cac_cert=customer.cac_cert);

> explain update customer set login_name =
> (select "NESSOuserName" from person
> where person.cac_cert=customer.cac_cert);

That's not a bug.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #5755: Query Optimzer Bug
@ 2010-11-17 18:37  Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Heikki Linnakangas @ 2010-11-17 18:37 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Elliott Groszek <elliott.groszek@navy.mil>; pgsql-bugs

On 17.11.2010 18:05, Tom Lane wrote:
> "Elliott Groszek"<elliott.groszek@navy.mil>  writes:
>> The following SQL statements produce different query plans even though
>> "phone" is not reference in the SQL!
>
>> explain update customer set login_name =
>> (select "NESSOuserName" from person,phone
>> where person.cac_cert=customer.cac_cert);
>
>> explain update customer set login_name =
>> (select "NESSOuserName" from person
>> where person.cac_cert=customer.cac_cert);
>
> That's not a bug.

Particularly, note that they produce different results if "phone" table 
is empty.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2010-11-17 18:37 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2010-11-16 22:39 BUG #5755: Query Optimzer Bug Elliott Groszek <elliott.groszek@navy.mil>
2010-11-17 16:05 ` Tom Lane <tgl@sss.pgh.pa.us>
2010-11-17 18:37   ` Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox