Re: index & Bitmap Heap Scan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Paul <paul(at)wayr(dot)org>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: index & Bitmap Heap Scan
Date: 2007-08-28 16:55:58
Message-ID: 29055.1188320158@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Paul <paul(at)wayr(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Anton Melser 2007-08-28 18:36:11 Re: Postgres performance problem
Previous Message Mark Lewis 2007-08-28 16:51:31 Re: Fwd: 8.2 Query 10 times slower than 8.1 (view-heavy)