Re: Statistics and selectivity estimation for ranges
Heikki Linnakangas <hlinnakangas@vmware.com>
From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Alexander Korotkov <aekorotkov@gmail.com>
Cc: Jeff Davis <pgsql@j-davis.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2013-03-14T13:44:19Z
Lists: pgsql-hackers
On 01.03.2013 16:22, Alexander Korotkov wrote: > On Wed, Mar 13, 2013 at 11:10 PM, Heikki Linnakangas< > hlinnakangas@vmware.com> wrote: > >> On 01.03.2013 16:22, Alexander Korotkov wrote: >> >>>> frac = area / (length2 - length1); >>>> >>> you can get NaN result. I've especially adjusted the code to get more of >>> less correct result in this case. >> >> Hmm, good point. I think I managed to fix those cases in the attached >> version. Is there any other corner case that I missed? > > Did you try test case by Jeff Davis on this thread? > http://www.postgresql.org/message-id/1355167304.3896.37.camel@jdavis > I try it with attached version of patch and get NaN estimate. Thanks, fixed that too. Committed with a little bit more clean up and fixes. Thank you for bearing with this long process :-). And many thanks Jeff for the review, and sorry that I forgot to credit you for that in the commit message. - Heikki