Fix some planner performance problems with large WHERE clauses, by
Tom Lane <tgl@sss.pgh.pa.us>
Fix some planner performance problems with large WHERE clauses, by introducing new 'FastList' list-construction subroutines to use in hot spots. This avoids the O(N^2) behavior of repeated lappend's by keeping a tail pointer, while not changing behavior by reversing list order as the lcons() method would do.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/executor/execQual.c | modified | +19 −15 |
| src/backend/nodes/list.c | modified | +117 −3 |
| src/backend/optimizer/path/indxpath.c | modified | +43 −36 |
| src/backend/optimizer/path/orindxpath.c | modified | +10 −5 |
| src/backend/optimizer/prep/prepqual.c | modified | +98 −85 |
| src/backend/optimizer/util/clauses.c | modified | +51 −42 |
| src/backend/optimizer/util/var.c | modified | +5 −5 |
| src/include/nodes/pg_list.h | modified | +21 −1 |