In the executor, use an array of pointers to access the rangetable.
Tom Lane <tgl@sss.pgh.pa.us>
In the executor, use an array of pointers to access the rangetable. Instead of doing a lot of list_nth() accesses to es_range_table, create a flattened pointer array during executor startup and index into that to get at individual RangeTblEntrys. This eliminates one source of O(N^2) behavior with lots of partitions. (I'm not exactly convinced that it's the most important source, but it's an easy one to fix.) Amit Langote and David Rowley Discussion: https://postgr.es/m/468c85d9-540e-66a2-1dde-fec2b741e688@lab.ntt.co.jp
Files
| Path | Change | +/− |
|---|---|---|
| contrib/postgres_fdw/postgres_fdw.c | modified | +6 −6 |
| src/backend/commands/copy.c | modified | +2 −3 |
| src/backend/commands/trigger.c | modified | +1 −1 |
| src/backend/executor/execExprInterp.c | modified | +3 −3 |
| src/backend/executor/execMain.c | modified | +14 −20 |
| src/backend/executor/execUtils.c | modified | +45 −4 |
| src/backend/executor/nodeLockRows.c | modified | +1 −1 |
| src/backend/replication/logical/worker.c | modified | +1 −2 |
| src/include/executor/executor.h | modified | +9 −0 |
| src/include/nodes/execnodes.h | modified | +5 −2 |
| src/include/parser/parsetree.h | modified | +0 −10 |
Discussion
- executor relation handling 62 messages · 2018-08-16 → 2019-02-10