Re: Forcing HashAggregation prior to index scan? - Mailing list pgsql-performance

From Tom Lane
Subject Re: Forcing HashAggregation prior to index scan?
Date
Msg-id 2132.1089429004@sss.pgh.pa.us
Whole thread Raw
In response to Forcing HashAggregation prior to index scan?  (Eugene <emelamud@yahoo.com>)
List pgsql-performance
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

pgsql-performance by date:

Previous
From: Mark Kirkwood
Date:
Subject: Re: Cursors performance
Next
From: Laurent Martelli
Date:
Subject: Re: achat borne wifi