pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Paul <paul@wayr.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: index & Bitmap Heap Scan
Date: Tue, 28 Aug 2007 12:55:58 -0400
Message-ID: <29055.1188320158@sss.pgh.pa.us> (raw)
In-Reply-To: <1188290949.29582.9.camel@thory>
References: <1188290949.29582.9.camel@thory>

Paul <paul@wayr.org> writes:
> Why in the first case, pgsql uses the "better" index and if i search
> r_service instead of r_numero pgsql does a "Bitmap Heap scan" first ?

Given the difference in the number of rows to be fetched, both plan
choices look pretty reasonable to me.  If you want to experiment,
you can try forcing the other choice in each case (use enable_indexscan
and enable_bitmapscan) and see how fast it is, but I suspect the planner
got it right.

Beware of cache effects when trying two plans in quick succession ---
the second one might go faster just because all the data is already
swapped in.

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <29055.1188320158@sss.pgh.pa.us>
Permalink:  ../29055.1188320158@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/29055.1188320158@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, paul@wayr.org
  Subject: Re: index & Bitmap Heap Scan
  In-Reply-To: <29055.1188320158@sss.pgh.pa.us>

* 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