Re: [PATCH] Use optimized single-datum tuplesort in ExecSort

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: [PATCH] Use optimized single-datum tuplesort in ExecSort
Дата
Msg-id CAApHDvp6L3GOEStvUYJomyeO-6HaAs4mZCjCXDm0vT2u1x17Cg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [PATCH] Use optimized single-datum tuplesort in ExecSort  (Ranier Vilela <ranier.vf@gmail.com>)
Ответы Re: [PATCH] Use optimized single-datum tuplesort in ExecSort
Список pgsql-hackers
On Wed, 14 Jul 2021 at 00:06, Ranier Vilela <ranier.vf@gmail.com> wrote:
>
> Em ter., 13 de jul. de 2021 às 04:19, Ronan Dunklau <ronan.dunklau@aiven.io> escreveu:
>> I would be
>> surprised the check adds that much to the whole execution though.
>
> I think this branch is a misprediction.

It could be.  I wondered that myself when I saw Ronan's results were
better than mine for 2,4 and 7.  However, I think Ronan had quite a
bit of noise in his results as there's no reason for the speedup in
tests 2,4 and 7.

> In most cases is it not datumSort?

who knows.  Maybe someone's workload always requires the datum sort.

> That's why I would like to use unlikely.

We really only use unlikely() in cases where we want to move code out
of line to a cold area because it's really never executed under normal
circumstances. We tend to do that for ERROR cases as we don't ever
really want to optimise for errors. We also sometimes do it when some
function has a branch to initialise something during the first call.
The case in question here does not fit for either of those two cases.

> IMO all the tests should all be to verify past behavior first.

I'm not quire sure what you mean there.

David



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

Предыдущее
От: Alexander Korotkov
Дата:
Сообщение: Re: unnesting multirange data types
Следующее
От: Ranier Vilela
Дата:
Сообщение: Re: [PATCH] Use optimized single-datum tuplesort in ExecSort