diff options
| author | Teodor Sigaev | 2016-04-08 16:31:49 +0000 |
|---|---|---|
| committer | Teodor Sigaev | 2016-04-08 16:45:59 +0000 |
| commit | 386e3d7609c49505e079c40c65919d99feb82505 (patch) | |
| tree | dd8f434e5401588c2b4f9e2068f396c5ce198cf6 /src/include/utils | |
| parent | 339025c68f95d3cb2c42478109cafeaf414c7fe0 (diff) | |
CREATE INDEX ... INCLUDING (column[, ...])
Now indexes (but only B-tree for now) can contain "extra" column(s) which
doesn't participate in index structure, they are just stored in leaf
tuples. It allows to use index only scan by using single index instead
of two or more indexes.
Author: Anastasia Lubennikova with minor editorializing by me
Reviewers: David Rowley, Peter Geoghegan, Jeff Janes
Diffstat (limited to 'src/include/utils')
| -rw-r--r-- | src/include/utils/rel.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index c7582c2a11..6ff4b2c5ea 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -341,11 +341,25 @@ typedef struct ViewOptions /* * RelationGetNumberOfAttributes - * Returns the number of attributes in a relation. + * Returns the total number of attributes in a relation. */ #define RelationGetNumberOfAttributes(relation) ((relation)->rd_rel->relnatts) /* + * IndexRelationGetNumberOfAttributes + * Returns the number of attributes in an index. + */ +#define IndexRelationGetNumberOfAttributes(relation) \ + ((relation)->rd_index->indnatts) + +/* + * IndexRelationGetNumberOfKeyAttributes + * Returns the number of key attributes in an index. + */ +#define IndexRelationGetNumberOfKeyAttributes(relation) \ + ((relation)->rd_index->indnkeyatts) + +/* * RelationGetDescr * Returns tuple descriptor for a relation. */ |
