Re: Use virtual tuple slot for Unique node

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Use virtual tuple slot for Unique node
Дата
Msg-id CAApHDvr358MErpm-5_jEsCfVDFpuPhN=8_xPbtAfAbqSs7HXsA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Use virtual tuple slot for Unique node  (David Rowley <dgrowleyml@gmail.com>)
Ответы Re: Use virtual tuple slot for Unique node  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
Список pgsql-hackers
On Wed, 27 Sept 2023 at 20:01, David Rowley <dgrowleyml@gmail.com> wrote:
>
> On Sat, 23 Sept 2023 at 03:15, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
> > So not a win in this case. Could you peek at the outer slot type, and
> > use the same kind of slot for the Unique's result? Or some more
> > complicated logic, like use a virtual slot if all the values are
> > pass-by-val? I'd also like to keep this simple, though...
> >
> > Would this kind of optimization make sense elsewhere?
>
> There are a few usages of ExecGetResultSlotOps(). e.g ExecInitHashJoin().
>
> If I adjust the patch to:
>
> -       ExecInitResultTupleSlotTL(&uniquestate->ps, &TTSOpsMinimalTuple);
> +       ExecInitResultTupleSlotTL(&uniquestate->ps,
> +
> ExecGetResultSlotOps(outerPlanState(uniquestate),
> +
>                             NULL));

Just to keep this from going cold, here's that in patch form for
anyone who wants to test.

I spent a bit more time running some more benchmarks and I don't see
any workload where it slows things down.  I'd be happy if someone else
had a go at finding a regression.

David

Вложения

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

Предыдущее
От: Richard Guo
Дата:
Сообщение: Re: Check each of base restriction clauses for constant-FALSE-or-NULL
Следующее
От: Esteban Zimanyi
Дата:
Сообщение: Fwd: Advice about preloaded libraries