diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-05-27 23:31:21 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-05-27 23:31:21 +0000 |
commit | 32e8fc4a28dd718aef16b9f617602c88b1f5f7e1 (patch) | |
tree | 7132d4430bebde31955c392787c1a7b829b0d023 /src/backend/access/index/genam.c | |
parent | dd67cf365a76ee875d7bc3aa3788a243fce4776f (diff) |
Arrange to cache fmgr lookup information for an index's access method
routines in the index's relcache entry, instead of doing a fresh fmgr_info
on every index access. We were already doing this for the index's opclass
support functions; not sure why we didn't think to do it for the AM
functions too. This supersedes the former method of caching (only)
amgettuple in indexscan scan descriptors; it's an improvement because the
function lookup can be amortized across multiple statements instead of
being repeated for each statement. Even though lookup for builtin
functions is pretty cheap, this seems to drop a percent or two off some
simple benchmarks.
Diffstat (limited to 'src/backend/access/index/genam.c')
-rw-r--r-- | src/backend/access/index/genam.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/backend/access/index/genam.c b/src/backend/access/index/genam.c index d2504de2190..90e910f343f 100644 --- a/src/backend/access/index/genam.c +++ b/src/backend/access/index/genam.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/index/genam.c,v 1.47 2005/04/14 20:03:23 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/access/index/genam.c,v 1.48 2005/05/27 23:31:20 tgl Exp $ * * NOTES * many of the old access method routines have been turned into @@ -86,6 +86,7 @@ RelationGetIndexScan(Relation indexRelation, else scan->keyData = NULL; + scan->is_multiscan = false; /* caller may change this */ scan->kill_prior_tuple = false; scan->ignore_killed_tuples = true; /* default setting */ scan->keys_are_unique = false; /* may be set by index AM */ @@ -101,10 +102,6 @@ RelationGetIndexScan(Relation indexRelation, scan->xs_ctup.t_data = NULL; scan->xs_cbuf = InvalidBuffer; - /* mark cached function lookup data invalid; it will be set later */ - scan->fn_getnext.fn_oid = InvalidOid; - scan->fn_getmulti.fn_oid = InvalidOid; - scan->unique_tuple_pos = 0; scan->unique_tuple_mark = 0; |