On Mon, 2008-10-27 at 16:39 +0000, Mark Cave-Ayland wrote:
> I'm experiencing a strange issue with PostgreSQL 8.3.3 whereby adding
> "LIMIT 1" to the query increases the query time from several 10s of ms
> to over 5s, and was wondering if anyone with more planner-fu can shed
> some light on this.
Sounds like one for the performance list.
LIMIT prevents the planner from transforming subselects. Maybe you want
EXISTS.
--
Simon Riggs www.2ndQuadrant.com
PostgreSQL Training, Services and Support