BUG #5755: Query Optimzer Bug

Started by Elliott Groszekover 15 years ago3 messagesbugs
Jump to latest
#1Elliott Groszek
elliott.groszek@navy.mil

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Elliott Groszek (#1)
Re: BUG #5755: Query Optimzer Bug

"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

#3Heikki Linnakangas
heikki.linnakangas@enterprisedb.com
In reply to: Tom Lane (#2)
Re: BUG #5755: Query Optimzer Bug

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