pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Skip system attributes when applying mvdistinct stats
Date: Sat, 16 Nov 2019 01:34:08 +0000
Message-ID: <E1iVmyW-0002aF-AR@gemulon.postgresql.org> (raw)

Skip system attributes when applying mvdistinct stats

When estimating number of distinct groups, we failed to ignore system
attributes when matching the group expressions to mvdistinct stats,
causing failures like

  ERROR: negative bitmapset member not allowed

Fix that by simply skipping anything that is not a regular attribute.
Backpatch to PostgreSQL 10, where the extended stats were introduced.

Bug: #16111
Reported-by: Tuomas Leikola
Author: Tomas Vondra
Backpatch-through: 10
Discussion: https://postgr.es/m/16111-687799584c3a7e73@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d482f7f867b58bbd29f65a4471eca8c5b57a7da0

Modified Files
--------------
src/backend/utils/adt/selfuncs.c        | 19 ++++++++++++++-----
src/test/regress/expected/stats_ext.out |  7 +++++++
src/test/regress/sql/stats_ext.sql      |  3 +++
3 files changed, 24 insertions(+), 5 deletions(-)



view thread (4+ messages)  latest in thread

Message-ID: <E1iVmyW-0002aF-AR@gemulon.postgresql.org>
Permalink:  ../E1iVmyW-0002aF-AR@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iVmyW-0002aF-AR@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tomas.vondra@postgresql.org
  Subject: Re: pgsql: Skip system attributes when applying mvdistinct stats
  In-Reply-To: <E1iVmyW-0002aF-AR@gemulon.postgresql.org>
  References: <E1iVmyW-0002aF-AR@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox