Re: [HACKERS] Add support for tuple routing to foreign partitions

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Etsuro Fujita <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, Maksim Milyutin <milyutinma(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Add support for tuple routing to foreign partitions
Date: 2017-12-18 09:14:17
Message-ID: f3edd72a-302a-2a6b-98f3-cc5c77c61d76@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fujita-san,

On 2017/12/12 21:21, Etsuro Fujita wrote:
> Hi Maksim,
>
> (2017/12/12 17:57), Maksim Milyutin wrote:
>> Your patch already is not applied on master. Please rebase it.
>
> Done.  Please find attached an updated version of the patch.

Thanks for sending the updated version of the patch.

I noticed that this patch introduces a partition_rels field in
ModifyTable, which contains the RT indexes of *all* leaf partitions in the
partition tree. That means we now expand the partition inheritance tree
in the planner even in the INSERT case, simply because some of the leaf
partitions might be foreign tables which must be looked at by the planner.
I'm somewhat concerned about the performance implications of that. Now,
to insert even a single row into a partitioned table, which may not even
be routed to any of its foreign partitions, we are going to have to expand
the inheritance twice -- once by the planner to handle foreign partitions
and then by the executor when setting up the tuple routing information.

Is there any reason why we have to to things this way, beside the fact
that the PlanForeignModify() API appears to be callable from only within a
valid planner context?

Thanks,
Amit

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2017-12-18 09:53:58 Re: GSoC 2018
Previous Message Ildus Kurbangaliev 2017-12-18 08:54:31 Re: [HACKERS] Custom compression methods