Re: Slow query: bitmap scan troubles

From: Claudio Freire <klaussfreire(at)gmail(dot)com>
To: postgresql(at)foo(dot)me(dot)uk
Cc: postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Slow query: bitmap scan troubles
Date: 2012-12-04 18:31:50
Message-ID: CAGTBQpaueZhezPjfM8Vaw1UExeYJh6jR6+6S0Qk_k59Bb5m=MQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

On Tue, Dec 4, 2012 at 3:03 PM, <postgresql(at)foo(dot)me(dot)uk> wrote:
>
> Though that doesn't account for the 70x difference between the speed of the
> two queries in actuality given a pretty similar expected speed (does it?).
> It does go some way to explaining why a bad choice of plan was made.

I still don't think it does. I still think the problem is the GUC settings.

The slow plan joins in a way that processes all 3M rows in both sides
of the join, and pg knows it.
The fast plan only processes 5k of them. And pg knows it. Why is it
choosing to process 3M rows?

If there's negative correlation, it only means less rows will be
produced, but the nested loop and and the right-hand index scan still
happens.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Claudio Freire 2012-12-04 18:32:57 Re: Slow query: bitmap scan troubles
Previous Message Philip Scott 2012-12-04 18:31:05 Re: Slow query: bitmap scan troubles

Browse pgsql-performance by date

  From Date Subject
Next Message Claudio Freire 2012-12-04 18:32:57 Re: Slow query: bitmap scan troubles
Previous Message Philip Scott 2012-12-04 18:31:05 Re: Slow query: bitmap scan troubles