Skip site navigation (1) Skip section navigation (2)

Re: Why the difference in plans ??

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Joost Kraaijeveld" <J(dot)Kraaijeveld(at)Askesis(dot)nl>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Why the difference in plans ??
Date: 2006-09-15 14:08:35
Message-ID: 24190.1158329315@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
"Joost Kraaijeveld" <J(dot)Kraaijeveld(at)Askesis(dot)nl> writes:
> Why the difference and can I influence the result so that the first
> query plan (which is the fastest) is actually used in both cases (I
> would expect that the limit would be done after the sort?)? 

It likes the second plan because 6694025.41/353 < 41812.78.  It would
probably be right, too, if the number of matching rows were indeed 353,
but it seems there are only 7.  Try increasing your statistics target
and re-analyzing.

			regards, tom lane

In response to

Responses

pgsql-performance by date

Next:From: Pallav KalvaDate: 2006-09-15 15:09:35
Subject: Optimize SQL
Previous:From: Spiegelberg, GregDate: 2006-09-15 12:43:26
Subject: Re: RAID 0 not as fast as expected

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group