Re: Query Plan - Bitmap Index Scan and Views

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rusty Conover <rconover(at)infogears(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query Plan - Bitmap Index Scan and Views
Date: 2006-08-05 02:15:18
Message-ID: 24233.1154744118@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Rusty Conover <rconover(at)infogears(dot)com> writes:
> Is there any inherent benefit of using a the IN operator versus
> joining a temporary table? Should they offer near equal performance?
> It appears bitmap scan's aren't done when matching across a small
> temporary table.

I believe the problem you're facing is that existing PG releases
don't know how to rearrange join order in the face of outer joins,
and your view is full of outer joins. So the join against the temp
table happens after forming the full output of the view, whereas you
desperately need it to happen at the bottom of the join stack.

CVS tip (8.2-to-be) has some ability to rearrange outer joins, and
I'm interested to know whether it's smart enough to fix your problem.
But you have not provided enough info to let someone else duplicate
your test case. Would you be willing to download CVS or a recent
nightly snapshot and see what it does with your problem?

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Rusty Conover 2006-08-05 02:56:54 Re: Query Plan - Bitmap Index Scan and Views
Previous Message Rusty Conover 2006-08-04 22:37:55 Query Plan - Bitmap Index Scan and Views