aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache/relcache.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2013-03-06 23:47:38 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2013-03-06 23:48:09 -0500
commit1908abc4a37d397356c9cdf0fd31c33a86281d63 (patch)
tree607be9f8752401246ad57e8b3371e62cf6120180 /src/backend/utils/cache/relcache.c
parent97951139164055d6bae5aae7ea058c28e1462253 (diff)
downloadpostgresql-1908abc4a37d397356c9cdf0fd31c33a86281d63.tar.gz
postgresql-1908abc4a37d397356c9cdf0fd31c33a86281d63.zip
Arrange to cache FdwRoutine structs in foreign tables' relcache entries.
This saves several catalog lookups per reference. It's not all that exciting right now, because we'd managed to minimize the number of places that need to fetch the data; but the upcoming writable-foreign-tables patch needs this info in a lot more places.
Diffstat (limited to 'src/backend/utils/cache/relcache.c')
-rw-r--r--src/backend/utils/cache/relcache.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index ba03dfcbb2d..5b1d1e5b10a 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -1846,6 +1846,8 @@ RelationDestroyRelation(Relation relation)
MemoryContextDelete(relation->rd_indexcxt);
if (relation->rd_rulescxt)
MemoryContextDelete(relation->rd_rulescxt);
+ if (relation->rd_fdwroutine)
+ pfree(relation->rd_fdwroutine);
pfree(relation);
}
@@ -4410,7 +4412,7 @@ load_relcache_init_file(bool shared)
* format is complex and subject to change). They must be rebuilt if
* needed by RelationCacheInitializePhase3. This is not expected to
* be a big performance hit since few system catalogs have such. Ditto
- * for index expressions, predicates, and exclusion info.
+ * for index expressions, predicates, exclusion info, and FDW info.
*/
rel->rd_rules = NULL;
rel->rd_rulescxt = NULL;
@@ -4420,6 +4422,7 @@ load_relcache_init_file(bool shared)
rel->rd_exclops = NULL;
rel->rd_exclprocs = NULL;
rel->rd_exclstrats = NULL;
+ rel->rd_fdwroutine = NULL;
/*
* Reset transient-state fields in the relcache entry