Skip system attributes when applying mvdistinct stats
Tomas Vondra <tomas.vondra@postgresql.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/selfuncs.c | modified | +14 −5 |
| src/test/regress/expected/stats_ext.out | modified | +7 −0 |
| src/test/regress/sql/stats_ext.sql | modified | +3 −0 |
Discussion
- BUG #16111: Unexpected query compilation error “negative bitmapset member not allowed” 4 messages · 2019-11-13 → 2019-12-05