Re: executor relation handling

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, David Rowley <dgrowleyml(at)gmail(dot)com>
Subject: Re: executor relation handling
Date: 2018-09-04 08:53:11
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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.


[1] Make executor's Range Table an array instead of a List

Attachment Content-Type Size
v2-0001-Don-t-lock-range-table-relations-in-the-executor.patch text/plain 30.5 KB
v2-0002-Remove-useless-fields-from-planner-nodes.patch text/plain 35.7 KB
v2-0003-Prune-PlanRowMark-of-relations-that-are-pruned-fr.patch text/plain 2.2 KB
v2-0004-Revise-executor-range-table-relation-opening-clos.patch text/plain 23.0 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Chi Gao 2018-09-04 09:14:35 Enable using IS NOT DISTINCT FROM in hash and merge joins
Previous Message Amit Langote 2018-09-04 08:26:12 Re: Make executor's Range Table an array instead of a List