Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit32e8fc4

Browse files
committed
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_infoon every index access. We were already doing this for the index's opclasssupport functions; not sure why we didn't think to do it for the AMfunctions too. This supersedes the former method of caching (only)amgettuple in indexscan scan descriptors; it's an improvement because thefunction lookup can be amortized across multiple statements instead ofbeing repeated for each statement. Even though lookup for builtinfunctions is pretty cheap, this seems to drop a percent or two off somesimple benchmarks.
1 parentdd67cf3 commit32e8fc4

File tree

6 files changed

+118
-96
lines changed

6 files changed

+118
-96
lines changed

‎src/backend/access/index/genam.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/access/index/genam.c,v 1.47 2005/04/14 20:03:23 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/access/index/genam.c,v 1.48 2005/05/27 23:31:20 tgl Exp $
1212
*
1313
* NOTES
1414
* many of the old access method routines have been turned into
@@ -86,6 +86,7 @@ RelationGetIndexScan(Relation indexRelation,
8686
else
8787
scan->keyData=NULL;
8888

89+
scan->is_multiscan= false;/* caller may change this */
8990
scan->kill_prior_tuple= false;
9091
scan->ignore_killed_tuples= true;/* default setting */
9192
scan->keys_are_unique= false;/* may be set by index AM */
@@ -101,10 +102,6 @@ RelationGetIndexScan(Relation indexRelation,
101102
scan->xs_ctup.t_data=NULL;
102103
scan->xs_cbuf=InvalidBuffer;
103104

104-
/* mark cached function lookup data invalid; it will be set later */
105-
scan->fn_getnext.fn_oid=InvalidOid;
106-
scan->fn_getmulti.fn_oid=InvalidOid;
107-
108105
scan->unique_tuple_pos=0;
109106
scan->unique_tuple_mark=0;
110107

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp