RE: [PATCH] Use optimized single-datum tuplesort in ExecSort
От | houzj.fnst@fujitsu.com |
---|---|
Тема | RE: [PATCH] Use optimized single-datum tuplesort in ExecSort |
Дата | |
Msg-id | OS0PR01MB57164E138C3CB2E12A91214094E49@OS0PR01MB5716.jpnprd01.prod.outlook.com обсуждение исходный текст |
Ответ на | Re: [PATCH] Use optimized single-datum tuplesort in ExecSort (David Rowley <dgrowleyml@gmail.com>) |
Ответы |
Re: [PATCH] Use optimized single-datum tuplesort in ExecSort
|
Список | pgsql-hackers |
From: David Rowley <dgrowleyml@gmail.com> > On Wed, 21 Jul 2021 at 13:39, James Coleman <jtc331@gmail.com> wrote: > > Thanks for doing the math measuring how much we could impact things. > > > > I'm +lots on getting this committed as is. > > Ok good. I plan on taking a final look at the v10 patch tomorrow morning NZ > time (about 12 hours from now) and if all is well, I'll push it. > > If anyone feels differently, please let me know before then. Hi, I noticed a minor thing about the v10 patch. - - for (;;) + if (node->datumSort) { - slot = ExecProcNode(outerNode); - - if (TupIsNull(slot)) - break; - - tuplesort_puttupleslot(tuplesortstate, slot); + for (;;) + { + slot = ExecProcNode(outerNode); + + if (TupIsNull(slot)) + break; + slot_getsomeattrs(slot, 1); + tuplesort_putdatum(tuplesortstate, + slot->tts_values[0], + slot->tts_isnull[0]); + } + } + else + { + for (;;) + { + slot = ExecProcNode(outerNode); + + if (TupIsNull(slot)) + break; + tuplesort_puttupleslot(tuplesortstate, slot); + } The above seems can be shorter like the following ? for (;;) { slot = ExecProcNode(outerNode); if (TupIsNull(slot)) break; if (node->datumSort) { slot_getsomeattrs(slot, 1); tuplesort_putdatum(tuplesortstate, slot->tts_values[0], slot->tts_isnull[0]); } else tuplesort_puttupleslot(tuplesortstate, slot); } Best regards, houzj
В списке pgsql-hackers по дате отправления: