Put back planner's ability to cache the results of mergejoinscansel(),
Tom Lane <tgl@sss.pgh.pa.us>
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.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/nodes/copyfuncs.c | modified | +5 −1 |
| src/backend/nodes/outfuncs.c | modified | +4 −1 |
| src/backend/optimizer/path/costsize.c | modified | +62 −13 |
| src/backend/optimizer/path/equivclass.c | modified | +155 −40 |
| src/backend/optimizer/prep/prepunion.c | modified | +4 −1 |
| src/backend/optimizer/util/restrictinfo.c | modified | +4 −1 |
| src/backend/utils/adt/selfuncs.c | modified | +26 −5 |
| src/include/nodes/relation.h | modified | +23 −1 |
| src/include/utils/selfuncs.h | modified | +2 −2 |