Re: strange row count estimates with conditions on multiple column

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

> Tomas Vondra <tv(at)fuzzy(dot)cz> writes:
>> 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.
>
> Huh? The default estimates are completely unrelated to the size of the
> histogram, and certainly unrelated to the default size of the
> histogram. We use those estimates when we don't have relevant stats.
> It's pure wishful thinking to suppose that changing the statistics
> target would have any impact on what the estimate ought to be in such
> a case.

Ooops, sorry for the crazy gibberish I've posted earlier. I thought those
default estimates work a somehow different and haven't checked that in the
code. The proposed 'optimization' obviously does not make any sense.

regards
Tomas

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adarsh Sharma 2010-12-13 04:57:06 Re: Performance tuning in Pgsql
Previous Message Tom Lane 2010-12-12 19:50:50 Re: strange row count estimates with conditions on multiple column