Re: Skip partition tuple routing with constant partition key

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Zhihong Yu <zyu(at)yugabyte(dot)com>
Cc: "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>, 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-05-27 04:22:01
Message-ID: CA+HiwqF_8h9muDZRzRLMDSmgrqwYShX+E9Bg067EWzeM8F+3nA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Thu, May 27, 2021 at 2:30 AM Zhihong Yu <zyu(at)yugabyte(dot)com> wrote:
>>
>> Hi, Amit:
>
>
> For ConvertTupleToPartition() in 0001-ExecFindPartition-cache-last-used-partition-v3.patch:
>
> + if (tempslot != NULL)
> + ExecClearTuple(tempslot);
>
> If tempslot and parent_slot point to the same slot, should ExecClearTuple() still be called ?

Yeah, we decided back in 1c9bb02d8ec that it's necessary to free the
slot if it's the same slot as a parent partition's
PartitionDispatch->tupslot ("freeing parent's copy of the tuple").
Maybe we don't need this parent-slot-clearing anymore due to code
restructuring over the last 3 years, but that will have to be a
separate patch.

I hope the attached updated patch makes it a bit more clear what's
going on. I refactored more of the code in ExecFindPartition() to
make this patch more a bit more readable.

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

Attachment Content-Type Size
0002-ExecPartitionCheck-pre-compute-partition-key-express.patch application/octet-stream 8.6 KB
0001-ExecFindPartition-cache-last-used-partition-v4.patch application/octet-stream 11.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2021-05-27 04:23:24 Re: Parallel Inserts in CREATE TABLE AS
Previous Message Amit Kapila 2021-05-27 04:17:20 Re: Decoding speculative insert with toast leaks memory