diff options
author | Teodor Sigaev <teodor@sigaev.ru> | 2016-04-08 19:31:49 +0300 |
---|---|---|
committer | Teodor Sigaev <teodor@sigaev.ru> | 2016-04-08 19:45:59 +0300 |
commit | 386e3d7609c49505e079c40c65919d99feb82505 (patch) | |
tree | dd8f434e5401588c2b4f9e2068f396c5ce198cf6 /src/backend/commands/matview.c | |
parent | 339025c68f95d3cb2c42478109cafeaf414c7fe0 (diff) | |
download | postgresql-386e3d7609c49505e079c40c65919d99feb82505.tar.gz postgresql-386e3d7609c49505e079c40c65919d99feb82505.zip |
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/backend/commands/matview.c')
-rw-r--r-- | src/backend/commands/matview.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/commands/matview.c b/src/backend/commands/matview.c index f00aab39e7b..59d5aa44426 100644 --- a/src/backend/commands/matview.c +++ b/src/backend/commands/matview.c @@ -612,7 +612,7 @@ refresh_by_match_merge(Oid matviewOid, Oid tempOid, Oid relowner, RelationGetRelationName(tempRel)); diffname = make_temptable_name_n(tempname, 2); - relnatts = matviewRel->rd_rel->relnatts; + relnatts = RelationGetNumberOfAttributes(matviewRel); usedForQual = (bool *) palloc0(sizeof(bool) * relnatts); /* Open SPI context. */ @@ -698,11 +698,11 @@ refresh_by_match_merge(Oid matviewOid, Oid tempOid, Oid relowner, RelationGetIndexExpressions(indexRel) == NIL && RelationGetIndexPredicate(indexRel) == NIL) { - int numatts = indexStruct->indnatts; + int indnkeyatts = indexStruct->indnkeyatts; int i; /* Add quals for all columns from this index. */ - for (i = 0; i < numatts; i++) + for (i = 0; i < indnkeyatts; i++) { int attnum = indexStruct->indkey.values[i]; Oid type; |