Re: Skip partition tuple routing with constant partition key

Поиск
Список
Период
Сортировка
От Zhihong Yu
Тема Re: Skip partition tuple routing with constant partition key
Дата
Msg-id CALNJ-vTPZ4abZP68fyfDO+kc74WdbWYACms+oCykg4qRsB0XfQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Skip partition tuple routing with constant partition key  (Amit Langote <amitlangote09@gmail.com>)
Ответы Re: Skip partition tuple routing with constant partition key  (Amit Langote <amitlangote09@gmail.com>)
Список pgsql-hackers


On Wed, May 26, 2021 at 9:22 PM Amit Langote <amitlangote09@gmail.com> wrote:
Hi,

On Thu, May 27, 2021 at 2:30 AM Zhihong Yu <zyu@yugabyte.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
Hi, Amit:
Thanks for the explanation.

For CanUseSavedPartitionForTuple, nit: you can check !dispatch->savedPartResultInfo at the beginning and return early.
This would save some indentation.

 Cheers

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: Parallel Inserts in CREATE TABLE AS
Следующее
От: Amit Langote
Дата:
Сообщение: Re: Skip partition tuple routing with constant partition key