Some further performance tweaks for planning large inheritance trees that
Tom Lane <tgl@sss.pgh.pa.us>
Some further performance tweaks for planning large inheritance trees that are mostly excluded by constraints: do the CE test a bit earlier to save some adjust_appendrel_attrs() work on excluded children, and arrange to use array indexing rather than rt_fetch() to fetch RTEs in the main body of the planner. The latter is something I'd wanted to do for awhile anyway, but seeing list_nth_cell() as 35% of the runtime gets one's attention.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/path/allpaths.c | modified | +30 −17 |
| src/backend/optimizer/path/clausesel.c | modified | +2 −2 |
| src/backend/optimizer/path/costsize.c | modified | +4 −4 |
| src/backend/optimizer/plan/createplan.c | modified | +3 −3 |
| src/backend/optimizer/plan/planagg.c | modified | +2 −2 |
| src/backend/optimizer/plan/planmain.c | modified | +16 −1 |
| src/backend/optimizer/util/pathnode.c | modified | +2 −2 |
| src/backend/optimizer/util/plancat.c | modified | +5 −2 |
| src/backend/optimizer/util/relnode.c | modified | +6 −6 |
| src/backend/utils/adt/selfuncs.c | modified | +2 −2 |
| src/include/nodes/relation.h | modified | +19 −1 |