Re: Using Bitmap scan instead of Seq scan

From: Vick Khera <vivek(at)khera(dot)org>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Using Bitmap scan instead of Seq scan
Date: 2011-02-15 13:48:10
Message-ID: AANLkTinvzXGkf=FZU=SS73DccGhqhm3QY86X53qRL4sv@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Feb 14, 2011 at 12:40 PM, Ahmed Ossama <ahmed(at)aossama(dot)net> wrote:
> I did a REINDEX and ANALYZE on the table, disabled the seqscan and ran the
> query again with the same result.
>
> My question how do I make PostgreSQL always uses bitmap scan instead of seq
> scan?
>
> Any advice is very much appreciated.
>

Have a look at the config parameters related to sequential page cost
and random page cost. Perhaps you need to adjust the ratio between
them to better suit your hardware. The planner may nudge itself over
to the index scan if it thinks it won't be too expensive.

Also, I'm not sure the default sample size for analyze in 8.4, but it
should probably be set to 100 if it is not already.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dmitriy Igrishin 2011-02-15 13:51:10 Re: SELECT INTO array[i] with PL/pgSQL
Previous Message Niklas Langvig 2011-02-15 11:50:37 PostgresSQL 9.0 64 bit on windows 2008 64bit