pgsql: Fix extended statistics with partial analyzes

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix extended statistics with partial analyzes
Date: 2017-04-17 17:03:03
Message-ID: E1d0A3L-00015F-6h@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix extended statistics with partial analyzes

Either because of a previous ALTER TABLE .. SET STATISTICS 0 or because
of being invoked with a partial column list, ANALYZE could fail to
acquire sufficient data to build extended statistics. Previously, this
would draw an ERROR and fail to collect any statistics at all (extended
and regular). Change things so that we raise a WARNING instead, and
remove a hint that was wrong in half the cases.

Reported by: David Rowley
Discussion: https://postgr.es/m/CAKJS1f9Kk0NF6Fg7TA=JUXsjpS9kX6NVu27pb5QDCpOYAvb-Og@mail.gmail.com

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/bf2a691e02d7766f185d9d8e0f092222a5c0a129

Modified Files
--------------
src/backend/statistics/extended_stats.c | 83 +++++++++++++++++++++------------
src/test/regress/expected/stats_ext.out | 6 ++-
src/test/regress/sql/stats_ext.sql | 2 +
3 files changed, 60 insertions(+), 31 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-04-17 17:04:31 Re: pgsql: Fix integer-overflow problems in interval comparison.
Previous Message Tom Lane 2017-04-17 16:51:53 pgsql: Back-patch 9.4-era SSL renegotiation code into 9.3 and 9.2.