Re: [PERFORM] limiting results makes the query slower

2009-08-23 Thread Robert Haas
On Thu, Aug 20, 2009 at 9:50 PM, Jaime Casanova wrote: > in a web app we have a query that we want to show in limited results > at a time, this one executes in 10 seconds if i use limit but executes > in 300ms if i remove it. > why is that happening? the query is using and index for avoiding the >

[PERFORM] limiting results makes the query slower

2009-08-20 Thread Jaime Casanova
Hi, in a web app we have a query that we want to show in limited results at a time, this one executes in 10 seconds if i use limit but executes in 300ms if i remove it. why is that happening? the query is using and index for avoiding the sort so the nestloop should go only for the first 20 records