pgsql: Skip system attributes when applying mvdistinct stats

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема pgsql: Skip system attributes when applying mvdistinct stats
Дата
Msg-id E1iVmyW-0002aF-AR@gemulon.postgresql.org
обсуждение исходный текст
Список 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
------
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(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Thomas Munro
Дата:
Сообщение: pgsql: Always call ExecShutdownNode() if appropriate.
Следующее
От: Tomas Vondra
Дата:
Сообщение: pgsql: Skip system attributes when applying mvdistinct stats