Re: 8.4 semi-join slows down query performance (EXISTS) - Mailing list pgsql-hackers

From Guillaume Smet
Subject Re: 8.4 semi-join slows down query performance (EXISTS)
Date
Msg-id 1d4e0c10904210453u220bd05amf44bee24eb0e5f70@mail.gmail.com
Whole thread Raw
In response to 8.4 semi-join slows down query performance (EXISTS)  (vacuum@quantentunnel.de)
Responses Re: 8.4 semi-join slows down query performance (EXISTS)  ("steven king" <vacuum@quantentunnel.de>)
List pgsql-hackers
On Tue, Apr 21, 2009 at 11:38 AM,  <vacuum@quantentunnel.de> wrote:
> I've queries returning tupels of A, with a (sub-)selected constant-expression that indicates whether a referenced
tupelexists in B or not. For this issue the EXISTS clause is used.
 
>
> In past (8.3) the planner resolves this into index-scans using existing foreign-key indices -> fast query (1.5
secondsfor comparison). Now (in 8.4) the planner wants "semi-joins". Index-scans are not longer used and my query needs
600seconds to return.
 

That worries me a bit for one of our applications too. We use EXISTS
in several places to trick the planner when the statistics are way off
(cross columns/cross tables) and I'm not sure making EXISTS more
clever will help us.

-- 
Guillaume


pgsql-hackers by date:

Previous
From: Kedar Potdar
Date:
Subject: Automating Partitions in PostgreSQL - Query on syntax
Next
From: Greg Stark
Date:
Subject: Re: Automating Partitions in PostgreSQL - Query on syntax