Re: Big problems with query optimization

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: anipko(at)tornado(dot)nsk(dot)ru, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Big problems with query optimization
Date: 2001-05-06 16:09:41
Message-ID: 28510.989165381@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

pgsql-bugs(at)postgresql(dot)org writes:
> Release 7.0
> faqts=> explain select faqs.id from faqs, faq_keywords;
> NOTICE: QUERY PLAN:
> Nested Loop (cost=0.00..4908.80 rows=161320 width=8)
> -> Seq Scan on faqs (cost=0.00..2.40 rows=40 width=4)
> -> Seq Scan on faq_keywords (cost=0.00..82.33 rows=4033 width=4)
> EXPLAIN

> Compare with release 6.5 reaction:
> faqtat=> explain select faqs.id from faqs, faq_keywords;
> NOTICE: QUERY PLAN:
> Seq Scan on faqs (cost=43.00 rows=1000 width=4)
> EXPLAIN

7.0 is correct. 6.5 is broken. Read the SQL standard: "select a.f from
a" is not the same query as "select a.f from a,b". The latter should
return each a.f value as many times as there are rows in b.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message pgsql-bugs 2001-05-07 07:01:28 The ignored "_" character
Previous Message pgsql-bugs 2001-05-06 13:10:02 Big problems with query optimization