pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: tv@fuzzy.cz
To: Tony Capobianco <tcapobianco@prospectiv.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Oracle v. Postgres 9.0 query performance
Date: Wed, 8 Jun 2011 17:31:26 +0200
Message-ID: <df2c0e011c42342aa5d975028809d051.squirrel@sq.gransy.com> (raw)
In-Reply-To: <1307545892.1990.23.camel@tony1.localdomain>
References: <1307545892.1990.23.camel@tony1.localdomain>

> On Postgres, this same query takes about 58 minutes (could not run
> explain analyze because it is in progress):
>
> 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)
>

Please, post EXPLAIN ANALYZE, not just EXPLAIN. Preferably using
explain.depesz.com.

regards
Tomas




view thread (18+ messages)  latest in thread

Message-ID: <df2c0e011c42342aa5d975028809d051.squirrel@sq.gransy.com>
Permalink:  ../df2c0e011c42342aa5d975028809d051.squirrel@sq.gransy.com/
Also on:    postgresql.org/message-id/df2c0e011c42342aa5d975028809d051.squirrel@sq.gransy.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tv@fuzzy.cz, tcapobianco@prospectiv.com
  Subject: Re: Oracle v. Postgres 9.0 query performance
  In-Reply-To: <df2c0e011c42342aa5d975028809d051.squirrel@sq.gransy.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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