Re: Oracle v. Postgres 9.0 query performance

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Oracle v. Postgres 9.0 query performance
Дата
Msg-id 10260.1307547185@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Oracle v. Postgres 9.0 query performance  (Tony Capobianco <tcapobianco@prospectiv.com>)
Ответы Re: Oracle v. Postgres 9.0 query performance  (Tony Capobianco <tcapobianco@prospectiv.com>)
Список pgsql-performance
Tony Capobianco <tcapobianco@prospectiv.com> writes:
> pg_dw=# explain CREATE TABLE ecr_opens with (FILLFACTOR=100)
> pg_dw-# as
> pg_dw-# select o.emailcampaignid, count(memberid) opencnt
> pg_dw-#   from openactivity o,ecr_sents s
> pg_dw-#  where s.emailcampaignid = o.emailcampaignid
> pg_dw-#  group by o.emailcampaignid;
>                                                  QUERY
> PLAN
> -------------------------------------------------------------------------------------------------------------
>  GroupAggregate  (cost=0.00..1788988.05 rows=9939 width=12)
>    ->  Nested Loop  (cost=0.00..1742467.24 rows=9279316 width=12)
>          ->  Index Scan using ecr_sents_ecid_idx on ecr_sents s
> (cost=0.00..38.59 rows=479 width=4)
>          ->  Index Scan using openact_emcamp_idx on openactivity o
> (cost=0.00..3395.49 rows=19372 width=12)
>                Index Cond: (o.emailcampaignid = s.emailcampaignid)
> (5 rows)

> Should this query be hashing the smaller table on Postgres rather than
> using nested loops?

Yeah, seems like it.  Just for testing purposes, do "set enable_nestloop
= 0" and see what plan you get then.

            regards, tom lane

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

Предыдущее
От: tv@fuzzy.cz
Дата:
Сообщение: Re: Oracle v. Postgres 9.0 query performance
Следующее
От: Tony Capobianco
Дата:
Сообщение: Re: Oracle v. Postgres 9.0 query performance