Re: update tuple routing and triggers

From: Amit Khandekar <amitdkhan(dot)pg(at)gmail(dot)com>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>
Subject: Re: update tuple routing and triggers
Date: 2018-02-06 04:56:33
Message-ID: CAJ3gD9eeQXCV7kzWxatw9ROCmOgbMzP7UBzYxjNyeJZmFXNUZw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks for the patch Amit.

I was wondering whether the same duplicate result rels issue can arise
for es_root_result_relations and es_result_relations. But I think for
inserts, es_root_result_relations is NULL, and for updates, these two
lists always have distinct set of relations. So this issue might not
be there for these two lists.

So what the patch does, looks good to me. One minor thing :

+ * Since we're newly creating this ResultRelInfo, add it to
+ * someplace where explain.c could find them.

I think above, instead of keeping the comment specifically for
explain.c, we should make it more general. The list is also used by
ExecGetTriggerResultRel(). (There, this duplicate relation issue does
not come up because it only uses the first one out of them).

I think the name es_tuple_routing_result_rels that you chose, sounds good.

Thanks
-Amit

On 6 February 2018 at 08:08, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> On 2018/02/06 10:48, Amit Langote wrote:
>> When working on this, I wondered if the es_leaf_result_relations should
>> actually be named something like es_tuple_routing_result_rels, to denote
>> the fact that they're created by tuple routing code. The current name
>> might lead to someone thinking that it contains *all* leaf result rels,
>> but that won't remain true after this patch. Thoughts?
>
> While I'm waiting to hear some opinion on the renaming, I updated the
> patch to clarify this in the comment about es_leaf_result_relations.
>
> Thanks,
> Amit

--
Thanks,
-Amit Khandekar
EnterpriseDB Corporation
The Postgres Database Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2018-02-06 04:58:57 Re: update tuple routing and triggers
Previous Message Kyotaro HORIGUCHI 2018-02-06 04:41:47 Re: Query running for very long time (server hanged) with parallel append