Re: strange row count estimates with conditions on multiple column

From: Tomas Vondra <tv(at)fuzzy(dot)cz>
To: pgsql-general(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: strange row count estimates with conditions on multiple column
Date: 2010-12-11 19:16:22
Message-ID: 4D03CE06.1050504@fuzzy.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dne 17.11.2010 06:58, Tom Lane napsal(a):
>> BTW I think the default estimate used to be 1000, so it was changed in
>> one of the 8.x releases? Can you point me to the docs? I've even tried
>> to find that in the sources, but unsuccessfully.
>
> It's DEFAULT_RANGE_INEQ_SEL, and AFAIR it hasn't changed in quite a while.
> But I wouldn't be surprised if the behavior of this example changed when
> we boosted the default statistics target.

I've been thinking about this and I think it might be improved. If I
understand the logic corretly, it says 'use half of the histogram bin
size'. But the value

#define DEFAULT_RANGE_INEQ_SEL 0.005

says it's always 0.5%, which is not not true if STATISTICS TARGET is not
100. This could actually yield 10x more precise estimates when the
STATISTICS TARGET is set to 1000.

OK, I know the default value is 100, just thinking about how to improve
the estimates.

Tomas

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message zab08 2010-12-12 02:19:20 SSL ques
Previous Message Andreas 'ads' Scherbaum 2010-12-11 19:05:49 PostgreSQL@FOSDEM 2011 - Reminder: call for papers ending soon!