Re: [PERFORM] Adding "LIMIT 1" kills performance.

2008-05-29 Thread Tom Lane
Chris Shoemaker <[EMAIL PROTECTED]> writes: > Still stumped, The short answer here is that the planner is guessing that scanning the index in ID order will come across the desired row (ie, the first one matching the join condition) in less time than it will take to select all the joinable rows, so

Re: [PERFORM] Adding "LIMIT 1" kills performance.

2008-05-29 Thread Chris Shoemaker
On Fri, May 30, 2008 at 02:23:46AM +0930, Shane Ambler wrote: > Chris Shoemaker wrote: >> [Attn list-queue maintainers: Please drop the earlier version >> of this email that I accidentally sent from an unsubscribed address. ] >> >> Hi, >> I'm having a strange problem with a slow-running select que

Re: [PERFORM] Adding "LIMIT 1" kills performance.

2008-05-29 Thread Shane Ambler
Chris Shoemaker wrote: [Attn list-queue maintainers: Please drop the earlier version of this email that I accidentally sent from an unsubscribed address. ] Hi, I'm having a strange problem with a slow-running select query. The query I use in production ends in "LIMIT 1", and it runs very slo

[PERFORM] Adding "LIMIT 1" kills performance.

2008-05-29 Thread Chris Shoemaker
[Attn list-queue maintainers: Please drop the earlier version of this email that I accidentally sent from an unsubscribed address. ] Hi, I'm having a strange problem with a slow-running select query. The query I use in production ends in "LIMIT 1", and it runs very slowly. But when I remove the