Re: bitmap scan much slower than index scan, hash_search_with_hash_value

From: Sergey Koposov <koposov(at)ast(dot)cam(dot)ac(dot)uk>
To: Peter Geoghegan <peter(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: bitmap scan much slower than index scan, hash_search_with_hash_value
Date: 2012-09-02 16:10:13
Message-ID: alpine.LRH.2.02.1209021700010.25232@calx046.ast.cam.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 2 Sep 2012, Peter Geoghegan wrote:

> On 2 September 2012 16:26, Sergey Koposov <koposov(at)ast(dot)cam(dot)ac(dot)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/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2012-09-02 16:30:17 Re: Fwd: PATCH: psql boolean display
Previous Message Tom Lane 2012-09-02 15:45:46 Re: Fwd: PATCH: psql boolean display