Re: Improvement of var_eq_non_const() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Improvement of var_eq_non_const()
Date
Msg-id 2781865.1740075685@sss.pgh.pa.us
Whole thread Raw
In response to Improvement of var_eq_non_const()  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-hackers
Teodor Sigaev <teodor@sigaev.ru> writes:
> I'd like to suggest to improve var_eq_non_const() by using knowledge of MCV and
> estimate the selectivity as quadratic mean of non-null fraction divided by
> number of distinct values (as it was before) and set of MCV selectivities.

What's the statistical interpretation of this calculation (that is,
the average MCV selectivity)?  Maybe it's better, but without any
context it seems like a pretty random thing to do.  In particular,
it seems like this could give radically different answers depending
on how many MCVs we chose to store, and I'm not sure we could argue
that the result gets more accurate with more MCVs stored.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Paul Jungwirth
Date:
Subject: Patch Review Workshop
Next
From: Pavel Stehule
Date:
Subject: Re: Proposal: pg_is_volatile function