From 4f06c688c7b4726ac9f5279d4a9f32408eec5356 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 22 Jan 2007 20:00:40 +0000 Subject: Put back planner's ability to cache the results of mergejoinscansel(), which I had removed in the first cut of the EquivalenceClass rewrite to simplify that patch a little. But it's still important --- in a four-way join problem mergejoinscansel() was eating about 40% of the planning time according to gprof. Also, improve the EquivalenceClass code to re-use join RestrictInfos rather than generating fresh ones for each join considered. This saves some memory space but more importantly improves the effectiveness of caching planning info in RestrictInfos. --- src/backend/optimizer/util/restrictinfo.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/backend/optimizer/util/restrictinfo.c') diff --git a/src/backend/optimizer/util/restrictinfo.c b/src/backend/optimizer/util/restrictinfo.c index ea8bb5c970..8251e75d65 100644 --- a/src/backend/optimizer/util/restrictinfo.c +++ b/src/backend/optimizer/util/restrictinfo.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/util/restrictinfo.c,v 1.52 2007/01/20 20:45:40 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/util/restrictinfo.c,v 1.53 2007/01/22 20:00:39 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -344,6 +344,9 @@ make_restrictinfo_internal(Expr *clause, restrictinfo->left_ec = NULL; restrictinfo->right_ec = NULL; + restrictinfo->left_em = NULL; + restrictinfo->right_em = NULL; + restrictinfo->scansel_cache = NIL; restrictinfo->outer_is_left = false; -- cgit v1.2.1