Re: bitmap scan much slower than index scan, hash_search_with_hash_value - Mailing list pgsql-hackers

From Sergey Koposov
Subject Re: bitmap scan much slower than index scan, hash_search_with_hash_value
Date
Msg-id alpine.LRH.2.02.1209021700010.25232@calx046.ast.cam.ac.uk
Whole thread Raw
In response to Re: bitmap scan much slower than index scan, hash_search_with_hash_value  (Peter Geoghegan <peter@2ndquadrant.com>)
List pgsql-hackers
On Sun, 2 Sep 2012, Peter Geoghegan wrote:

> On 2 September 2012 16:26, Sergey Koposov <koposov@ast.cam.ac.uk> wrote:
>
> That's why we support altering that value with an ALTER TABLE...ALTER
> COLUMN DDL statement. You might at least consider increasing the
> statistics target for the column first though, to see if that will
> make the n_distinct value better accord with reality.

Thanks, I've forgot about that possibility.

After fixing the n_distinct to the correct value the index scan became the 
preferred option. and the row number estimate for the index scan became 
more realistic

Sorry for the noise.    Sergey

*****************************************************
Sergey E. Koposov, PhD, Research Associate
Institute of Astronomy, University of Cambridge
Madingley road, CB3 0HA, Cambridge, UK
Tel: +44-1223-337-551 Web: http://www.ast.cam.ac.uk/~koposov/



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Fwd: PATCH: psql boolean display
Next
From: Pavel Stehule
Date:
Subject: Re: Fwd: PATCH: psql boolean display