mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +03:00
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
This commit is contained in:
@@ -341,10 +341,24 @@ 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.
|
||||
|
Reference in New Issue
Block a user