Re: Choosing values for multivariate MCV lists - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: Choosing values for multivariate MCV lists
Date
Msg-id CAEZATCWqqB3R+Oewq2u_ByS01-12+M4=yRARVvdmx4R0ZO-RvQ@mail.gmail.com
Whole thread Raw
In response to Re: Choosing values for multivariate MCV lists  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: Choosing values for multivariate MCV lists
List pgsql-hackers
On Thu, 20 Jun 2019 at 23:35, Tomas Vondra <tomas.vondra@2ndquadrant.com> wrote:
>
> On Thu, Jun 20, 2019 at 06:55:41AM +0100, Dean Rasheed wrote:
>
> >I'm not sure it's easy to justify ordering by Abs(freq-base_freq)/freq
> >though, because that would seem likely to put too much weight on the
> >least commonly occurring values.
>
> But would that be an issue, or a good thing? I mean, as long as the item
> is above mincount, we take the counts as reliable. As I explained, my
> motivation for proposing that was that both
>
>    ... (cost=... rows=1 ...) (actual=... rows=1000001 ...)
>
> and
>
>    ... (cost=... rows=1000000 ...) (actual=... rows=2000000 ...)
>
> have exactly the same Abs(freq - base_freq), but I think we both agree
> that the first misestimate is much more dangerous, because it's off by six
> orders of magnitude.
>

Hmm, that's a good example. That definitely suggests that we should be
trying to minimise the relative error, but also perhaps that what we
should be looking at is actually just the ratio freq / base_freq,
rather than their difference.

Regards,
Dean



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: benchmarking Flex practices
Next
From: Peter Eisentraut
Date:
Subject: allow_system_table_mods stuff