Thread: pgsql: Arrange to cache fmgr lookup information for an index's access

pgsql: Arrange to cache fmgr lookup information for an index's access

From
tgl@svr1.postgresql.org (Tom Lane)
Date:
Log Message:
-----------
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.

Modified Files:
--------------
    pgsql/src/backend/access/index:
        genam.c (r1.47 -> r1.48)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/index/genam.c.diff?r1=1.47&r2=1.48)
        indexam.c (r1.81 -> r1.82)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/access/index/indexam.c.diff?r1=1.81&r2=1.82)
    pgsql/src/backend/utils/cache:
        relcache.c (r1.223 -> r1.224)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/cache/relcache.c.diff?r1=1.223&r2=1.224)
    pgsql/src/include/access:
        genam.h (r1.50 -> r1.51)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/access/genam.h.diff?r1=1.50&r2=1.51)
        relscan.h (r1.38 -> r1.39)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/access/relscan.h.diff?r1=1.38&r2=1.39)
    pgsql/src/include/utils:
        rel.h (r1.83 -> r1.84)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/rel.h.diff?r1=1.83&r2=1.84)