Re: executor relation handling
Amit Langote <langote_amit_f8@lab.ntt.co.jp>
Attachments
- v2-0001-Don-t-lock-range-table-relations-in-the-executor.patch (text/plain) patch v2-0001
- v2-0002-Remove-useless-fields-from-planner-nodes.patch (text/plain) patch v2-0002
- v2-0003-Prune-PlanRowMark-of-relations-that-are-pruned-fr.patch (text/plain) patch v2-0003
- v2-0004-Revise-executor-range-table-relation-opening-clos.patch (text/plain) patch v2-0004
On 2018/08/16 17:22, Amit Langote wrote: > 0004-Revise-executor-range-table-relation-opening-closing.patch > > This adds two arrays to EState indexed by RT indexes, one for > RangeTblEntry's and another for Relation pointers. The former reduces the > cost of fetching RangeTblEntry by RT index. The latter is used by a newly > introduced function ExecRangeTableRelation(), which replaces heap_open for > relations that are contained in the range table. If a given RTE's > relation is opened by multiple times, only the first call of > ExecRangeTableRelation will go to relcache. David Rowely recently, independently [1], proposed one of the ideas mentioned above (store RangeTblEntry's in an array in EState). As I mentioned in reply to his email, I think his implementation of the idea is better than mine, so I've merged his patch in the above patch, except one part: instead of removing the es_range_table list altogether, I decided to keep it around so that ExecSerializePlan doesn't have to build one all over again from the array like his patch did. Updated patches attached; 0001-0003 are same as v1. Thanks, Amit [1] Make executor's Range Table an array instead of a List https://postgr.es/m/CAKJS1f9EypD_=xG6ACFdF=1cBjz+Z9hiHHSd-RqLjor+QyA-nw@mail.gmail.com
Commits
-
Avoid O(N^2) cost in ExecFindRowMark().
- f9eb7c14b08d 12.0 landed
-
Remove some unnecessary fields from Plan trees.
- 52ed730d511b 12.0 landed
-
Restore sane locking behavior during parallel query.
- 29ef2b310da9 12.0 landed
-
Remove more redundant relation locking during executor startup.
- f2343653f5b2 12.0 landed
-
In the executor, use an array of pointers to access the rangetable.
- d73f4c74dd34 12.0 landed
-
Centralize executor's opening/closing of Relations for rangetable entries.
- 9ddef36278a9 12.0 landed
-
Change executor to just Assert that table locks were already obtained.
- 9a3cebeaa7fd 12.0 landed
-
Change rewriter/planner/executor/plancache to depend on RTE rellockmode.
- 6e35939febf8 12.0 landed
-
Add assertions that we hold some relevant lock during relation open.
- b04aeb0a053e 12.0 landed
-
Create an RTE field to record the query's lock mode for each relation.
- fdba460a26af 12.0 landed