pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Tony Capobianco <tcapobianco@prospectiv.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Subject: Re: Oracle v. Postgres 9.0 query performance
Date: Wed, 8 Jun 2011 11:51:59 -0400
Message-ID: <20110608155159.GA18128@tamriel.snowman.net> (raw)
In-Reply-To: <1307547634.1990.26.camel@tony1.localdomain>
References: <1307545892.1990.23.camel@tony1.localdomain>
	<10260.1307547185@sss.pgh.pa.us>
	<1307547634.1990.26.camel@tony1.localdomain>

* Tony Capobianco (tcapobianco@prospectiv.com) wrote:
>  HashAggregate  (cost=4391163.81..4391288.05 rows=9939 width=12)
>    ->  Hash Join  (cost=14.78..4344767.23 rows=9279316 width=12)
>          Hash Cond: (o.emailcampaignid = s.emailcampaignid)
>          ->  Seq Scan on openactivity o  (cost=0.00..3529930.67
> rows=192540967 width=12)
>          ->  Hash  (cost=8.79..8.79 rows=479 width=4)
>                ->  Seq Scan on ecr_sents s  (cost=0.00..8.79 rows=479
> width=4)
> 
> Yikes.  Two sequential scans.

Err, isn't that more-or-less exactly what you want here?  The smaller
table is going to be hashed and then you'll traverse the bigger table
and bounce each row off the hash table.  Have you tried actually running
this and seeing how long it takes?  The bigger table doesn't look to be
*that* big, if your i/o subsystem is decent and you've got a lot of
memory available for kernel cacheing, should be quick.

	Thanks,

		Stephen

Attachments:

  signature.asc (application/pgp-signature, 197B) download

view thread (18+ messages)  latest in thread

Message-ID: <20110608155159.GA18128@tamriel.snowman.net>
Permalink:  ../20110608155159.GA18128@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20110608155159.GA18128@tamriel.snowman.net

 · 

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: sfrost@snowman.net, tcapobianco@prospectiv.com, tgl@sss.pgh.pa.us
  Subject: Re: Oracle v. Postgres 9.0 query performance
  In-Reply-To: <20110608155159.GA18128@tamriel.snowman.net>

* 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