pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <robertmhaas@gmail.com>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: mathieu@dezutter.org
Cc: pgsql-performance@postgresql.org
Subject: Re: Choice of bitmap scan over index scan
Date: Sun, 10 Jan 2010 21:52:25 -0500
Message-ID: <603c8f071001101852n7ce69d9atfc0b7aa65d8e357d@mail.gmail.com> (raw)
In-Reply-To: <4B49A3AF020000250002E138@gw.wicourts.gov>
References: <4B49A3AF020000250002E138@gw.wicourts.gov>

On Sun, Jan 10, 2010 at 10:53 AM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> seq_page_cost = 0.1
> random_page_cost = 0.1

These might not even be low enough.  The reason why bitmap index scans
win over plain index scans, in general, is because you make one pass
through the heap to get all the rows you need instead of bouncing
around doing lots of random access.  But of course if all the data is
in RAM then this argument falls down.

If these aren't enough to get the query planner to DTRT, then the OP
might want to try lowering them further and seeing how low he has to
go to flip the plan...

...Robert



view thread (14+ messages)  latest in thread

Message-ID: <603c8f071001101852n7ce69d9atfc0b7aa65d8e357d@mail.gmail.com>
Permalink:  ../603c8f071001101852n7ce69d9atfc0b7aa65d8e357d@mail.gmail.com/
Also on:    postgresql.org/message-id/603c8f071001101852n7ce69d9atfc0b7aa65d8e357d@mail.gmail.com

 · 

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: robertmhaas@gmail.com, Kevin.Grittner@wicourts.gov, mathieu@dezutter.org
  Subject: Re: Choice of bitmap scan over index scan
  In-Reply-To: <603c8f071001101852n7ce69d9atfc0b7aa65d8e357d@mail.gmail.com>

* 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