diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2010-11-29 12:29:42 -0500 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2010-11-29 12:30:43 -0500 |
| commit | c0b5fac7010fa3468577d3a90ee8783639500fed (patch) | |
| tree | 0c49a5abb23a8dcc62790fd5d9cd9d39a210f91b /src/include/utils/rel.h | |
| parent | 3c42efceb21b8dfe1b5686bd914520980933fcd4 (diff) | |
Simplify and speed up mapping of index opfamilies to pathkeys.
Formerly we looked up the operators associated with each index (caching
them in relcache) and then the planner looked up the btree opfamily
containing such operators in order to build the btree-centric pathkey
representation that describes the index's sort order. This is quite
pointless for btree indexes: we might as well just use the index's opfamily
information directly. That saves syscache lookup cycles during planning,
and furthermore allows us to eliminate the relcache's caching of operators
altogether, which may help in reducing backend startup time.
I added code to plancat.c to perform the same type of double lookup
on-the-fly if it's ever faced with a non-btree amcanorder index AM.
If such a thing actually becomes interesting for production, we should
replace that logic with some more-direct method for identifying the
corresponding btree opfamily; but it's not worth spending effort on now.
There is considerably more to do pursuant to my recent proposal to get rid
of sort-operator-based representations of sort orderings, but this patch
grabs some of the low-hanging fruit. I'll look at the remainder of that
work after the current commitfest.
Diffstat (limited to 'src/include/utils/rel.h')
| -rw-r--r-- | src/include/utils/rel.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h index 9ad92c299e8..39e0365c0b1 100644 --- a/src/include/utils/rel.h +++ b/src/include/utils/rel.h @@ -178,10 +178,10 @@ typedef struct RelationData /* * index access support info (used only for an index relation) * - * Note: only default operators and support procs for each opclass are - * cached, namely those with lefttype and righttype equal to the opclass's - * opcintype. The arrays are indexed by strategy or support number, which - * is a sufficient identifier given that restriction. + * Note: only default support procs for each opclass are cached, namely + * those with lefttype and righttype equal to the opclass's opcintype. + * The arrays are indexed by support function number, which is a + * sufficient identifier given that restriction. * * Note: rd_amcache is available for index AMs to cache private data about * an index. This must be just a cache since it may get reset at any time @@ -194,7 +194,6 @@ typedef struct RelationData RelationAmInfo *rd_aminfo; /* lookup info for funcs found in pg_am */ Oid *rd_opfamily; /* OIDs of op families for each index col */ Oid *rd_opcintype; /* OIDs of opclass declared input data types */ - Oid *rd_operator; /* OIDs of index operators */ RegProcedure *rd_support; /* OIDs of support procedures */ FmgrInfo *rd_supportinfo; /* lookup info for support procedures */ int16 *rd_indoption; /* per-column AM-specific flags */ |
