Re: Skip partition tuple routing with constant partition key

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>
Subject: Re: Skip partition tuple routing with constant partition key
Date: 2021-06-04 09:05:17
Message-ID: CA+HiwqEnp_iLNkSw1HhUUWt6OBuQVr3Y3O6T7s+OFc5GAhGqSg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 4, 2021 at 4:38 PM Amit Langote <amitlangote09(at)gmail(dot)com> wrote:
> On Thu, Jun 3, 2021 at 8:48 PM Amit Langote <amitlangote09(at)gmail(dot)com> wrote:
> > On Tue, Jun 1, 2021 at 5:43 PM houzj(dot)fnst(at)fujitsu(dot)com
> > <houzj(dot)fnst(at)fujitsu(dot)com> wrote:
> > > So, If we want to share the cached partition between statements, we seems cannot
> > > use ExecPartitionCheck. Instead, I tried directly invoke the partition support
> > > function(partsupfunc) to check If the cached info is correct. In this approach I
> > > tried cache the *bound offset* in PartitionDescData, and we can use the bound offset
> > > to get the bound datum from PartitionBoundInfoData and invoke the partsupfunc
> > > to do the CHECK.
> > >
> > > Attach a POC patch about it. Just to share an idea about sharing cached partition info
> > > between statements.
> >
> > I have not looked at your patch yet, but yeah that's what I would
> > imagine doing it.
>
> Just read it and think it looks promising.
>
> On code, I wonder why not add the rechecking-cached-offset code
> directly in get_partiiton_for_tuple(), instead of adding a whole new
> function for that. Can you please check the attached revised version?

Here's another, slightly more polished version of that. Also, I added
a check_cached parameter to get_partition_for_tuple() to allow the
caller to disable checking the cached version.

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

Attachment Content-Type Size
0001-cache-bound-offset_v3.patch application/octet-stream 7.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joel Jacobson 2021-06-04 09:17:20 Re: security_definer_search_path GUC
Previous Message Ajin Cherian 2021-06-04 08:59:35 Re: Decoding of two-phase xacts missing from CREATE_REPLICATION_SLOT command