pgsql: Partially revert commit 3d3bf62f30200500637b24fdb7b992a99f9704c3

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Partially revert commit 3d3bf62f30200500637b24fdb7b992a99f9704c3
Date: 2016-04-04 21:06:39
Message-ID: E1anBhn-0007j9-BN@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Partially revert commit 3d3bf62f30200500637b24fdb7b992a99f9704c3.

On reflection, the pre-existing logic in ANALYZE is specifically meant to
compare the frequency of a candidate MCV against the estimated frequency of
a random distinct value across the whole table. The change to compare it
against the average frequency of values actually seen in the sample doesn't
seem very principled, and if anything it would make us less likely not more
likely to consider a value an MCV. So revert that, but keep the aspect of
considering only nonnull values, which definitely is correct.

In passing, rename the local variables in these stanzas to
"ndistinct_table", to avoid confusion with the "ndistinct" that appears at
an outer scope in compute_scalar_stats.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/391159e03a8b69dd04a1432ceb800c7c4c3d608c

Modified Files
--------------
src/backend/commands/analyze.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2016-04-04 21:12:51 pgsql: Display WAL pointer in rm_redo error callback
Previous Message Alvaro Herrera 2016-04-04 20:15:05 Re: pgsql: XLogReader general code cleanup