Re: Big problems with query optimization

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Big problems with query optimization
Дата
Msg-id 28510.989165381@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Big problems with query optimization  (pgsql-bugs@postgresql.org)
Список pgsql-bugs
pgsql-bugs@postgresql.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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: Big problems with query optimization
Следующее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: The ignored "_" character