pgsql: Provide statistics for hypothetical BRIN indexes - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Provide statistics for hypothetical BRIN indexes
Date
Msg-id E1iXbD6-00014B-5z@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Provide statistics for hypothetical BRIN indexes

Trying to use hypothetical indexes with BRIN currently fails when trying
to access a relation that does not exist when looking for the
statistics.  With the current API, it is not possible to easily pass
a value for pages_per_range down to the hypothetical index, so this
makes use of the default value of BRIN_DEFAULT_PAGES_PER_RANGE, which
should be fine enough in most cases.

Being able to refine or enforce the hypothetical costs in more
optimistic ways would require more refactoring by filling in the
statistics when building IndexOptInfo in plancat.c.  This would involve
ABI breakages around the costing routines, something not fit for stable
branches.

This is broken since 7e534ad, so backpatch down to v10.

Author: Julien Rouhaud, Heikki Linnakangas
Reviewed-by: Álvaro Herrera, Tom Lane, Michael Paquier
Discussion: https://postgr.es/m/CAOBaU_ZH0LKEA8VFCocr6Lpte1ab0b6FpvgS0y4way+RPSXfYg@mail.gmail.com
Backpatch-through: 10

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/62074a34360b7a2b05f30087c9fe83da1c8bb6c8

Modified Files
--------------
src/backend/utils/adt/selfuncs.c | 33 +++++++++++++++++++++++++--------
1 file changed, 25 insertions(+), 8 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Sync patternsel_common's operator selection logic with pattern_p
Next
From: Amit Kapila
Date:
Subject: pgsql: Track statistics for spilling of changes from ReorderBuffer.