Re: partition routing layering in nodeModifyTable.c

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: partition routing layering in nodeModifyTable.c
Date: 2020-10-19 04:54:27
Message-ID: CA+HiwqFViT47Zbr_ASBejiK7iDG8=Q1swQ-tjM6caRPQ67pT=w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Oct 18, 2020 at 12:54 AM Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:
> On 2020-Oct-17, Amit Langote wrote:
> > Hmm, I don't see ri_PartitionCheckExpr as being a piece of routing
> > information, because it's primarily meant to be used when inserting
> > *directly* into a partition, although it's true we do initialize it in
> > routing target partitions too in some cases.
> >
> > Also, ChildToRootMap was introduced by the trigger transition table
> > project, not tuple routing. I think we misjudged this when we added
> > PartitionToRootMap to PartitionRoutingInfo, because it doesn't really
> > belong there. This patch fixes that by removing PartitionToRootMap.
> >
> > RootToPartitionMap and the associated partition slot is the only piece
> > of extra information that is needed by tuple routing target relations.
>
> Well, I was thinking on making the ri_PartitionInfo be about
> partitioning in general, not just specifically for partition tuple
> routing. Maybe Heikki is right that it may end up being simpler to
> remove ri_PartitionInfo altogether. It'd just be a couple of additional
> pointers in ResultRelInfo after all.

So that's 2 votes for removing PartitionRoutingInfo from the tree.
Okay, I have tried that in the attached 0002 patch. Also, I fixed
some comments in 0001 that still referenced PartitionToRootMap.

--
Amit Langote
EDB: http://www.enterprisedb.com

Attachment Content-Type Size
v19-0001-Revise-child-to-root-tuple-conversion-map-manage.patch application/octet-stream 22.4 KB
v19-0002-Remove-PartitionRoutingInfo-struct.patch application/octet-stream 12.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2020-10-19 05:17:42 Re: Transactions involving multiple postgres foreign servers, take 2
Previous Message Julien Rouhaud 2020-10-19 04:34:24 Re: [patch] ENUM errdetail should mention bytes, not chars