Document RelationGetIndexAttrBitmap better

Commit 19d8e2308b changed the list of set-of-columns that can be
returned by RelationGetIndexAttrBitmap, but didn't update its
"documentation".  That was pretty hard to read already, so rewrite to
make it more comprehensible, adding the missing values while at it.

Backpatch to 16, like that commit.

Discussion: https://postgr.es/m/20230809091155.7c7f3gttjk3dj4ze@alvherre.pgsql
Reviewed-by: Tomas Vondra <tomas.vondra@enterprisedb.com>
This commit is contained in:
Alvaro Herrera 2023-08-10 12:04:07 +02:00
parent 4d14ccd6af
commit b57cfb439b
No known key found for this signature in database
GPG Key ID: 1C20ACB9D5C564AE
2 changed files with 12 additions and 3 deletions

View File

@ -5150,9 +5150,15 @@ RelationGetIndexPredicate(Relation relation)
* simple index keys, but attributes used in expressions and partial-index
* predicates.)
*
* Depending on attrKind, a bitmap covering the attnums for all index columns,
* for all potential foreign key columns, or for all columns in the configured
* replica identity index is returned.
* Depending on attrKind, a bitmap covering attnums for certain columns is
* returned:
* INDEX_ATTR_BITMAP_KEY Columns in non-partial unique indexes not
* in expressions (i.e., usable for FKs)
* INDEX_ATTR_BITMAP_PRIMARY_KEY Columns in the table's primary key
* INDEX_ATTR_BITMAP_IDENTITY_KEY Columns in the table's replica identity
* index (empty if FULL)
* INDEX_ATTR_BITMAP_HOT_BLOCKING Columns that block updates from being HOT
* INDEX_ATTR_BITMAP_SUMMARIZED Columns included in summarizing indexes
*
* Attribute numbers are offset by FirstLowInvalidHeapAttributeNumber so that
* we can include system attributes (e.g., OID) in the bitmap representation.

View File

@ -54,6 +54,9 @@ extern List *RelationGetIndexPredicate(Relation relation);
extern Datum *RelationGetIndexRawAttOptions(Relation indexrel);
extern bytea **RelationGetIndexAttOptions(Relation relation, bool copy);
/*
* Which set of columns to return by RelationGetIndexAttrBitmap.
*/
typedef enum IndexAttrBitmapKind
{
INDEX_ATTR_BITMAP_KEY,