pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Eugene <emelamud@yahoo.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Forcing HashAggregation prior to index scan?
Date: Fri, 09 Jul 2004 23:10:04 -0400
Message-ID: <2132.1089429004@sss.pgh.pa.us> (raw)
In-Reply-To: <20040705231434.81471.qmail@web50708.mail.yahoo.com>
References: <20040705231434.81471.qmail@web50708.mail.yahoo.com>

Eugene <emelamud@yahoo.com> writes:
> Can I force HashAggregation before index scan? 

No.  But look into why the planner's rows estimate is so bad here:

>    ->  Index Scan using refseq_sequence_key2 on refseq_sequence s  (cost=0.00..1516.06 rows=389
> width=24) (actual time=0.352..491.107 rows=27391 loops=1)
>          Index Cond: ((species)::text = 'Homo sapiens'::text)

Have you ANALYZEd this table recently? If so, maybe you need a larger
statistics target for the species column.  The estimated row count
shouldn't be off by a factor of seventy...

			regards, tom lane



view thread (2+ messages)

Message-ID: <2132.1089429004@sss.pgh.pa.us>
Permalink:  ../2132.1089429004@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2132.1089429004@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, emelamud@yahoo.com
  Subject: Re: Forcing HashAggregation prior to index scan?
  In-Reply-To: <2132.1089429004@sss.pgh.pa.us>

* 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