From: | Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Skip system attributes when applying mvdistinct stats |
Date: | 2019-11-16 01:34:43 |
Message-ID: | E1iVmz5-0002ca-Tu@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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
------
REL_10_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/0b0f281cc0fe383162b170889e79502e21e6b35a
Modified Files
--------------
src/backend/utils/adt/selfuncs.c | 19 ++++++++++++++-----
src/test/regress/expected/stats_ext.out | 12 ++++++++++++
src/test/regress/sql/stats_ext.sql | 4 ++++
3 files changed, 30 insertions(+), 5 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tomas Vondra | 2019-11-16 02:07:46 | pgsql: Properly determine length for on-disk TOAST values |
Previous Message | Tomas Vondra | 2019-11-16 01:34:31 | pgsql: Skip system attributes when applying mvdistinct stats |