Re: Re: Reusing abbreviated keys during second pass of ordered [set] aggregates
От | Peter Geoghegan |
---|---|
Тема | Re: Re: Reusing abbreviated keys during second pass of ordered [set] aggregates |
Дата | |
Msg-id | CAM3SWZS3CvOaLF9rK01hnwNQRk0qMiJSu4suKQ1k7SdTpo7cfA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Re: Reusing abbreviated keys during second pass of ordered [set] aggregates (Peter Geoghegan <pg@heroku.com>) |
Ответы |
Re: Re: Reusing abbreviated keys during second pass of
ordered [set] aggregates
|
Список | pgsql-hackers |
On Wed, Dec 16, 2015 at 12:04 PM, Peter Geoghegan <pg@heroku.com> wrote: >> What kind of state is that? Can't we define this in terms of what it >> is rather than how it gets that way? > > It's zeroed. > > I guess we can update everything, including existing comments, to reflect that. Attached revision updates both the main commit (the optimization), and the backpatch commit (updated the contract). Changes: * Changes commit intended for backpatch to 9.5 to use new "zeroed" terminology (not "void" representation). * Puts fix within mergerun() (for this patch) in the same backpatch commit. We might as well keep this consistent, even though the correctness of 9.5 does not actually hinge upon having this change -- there is zero risk of breaking something in 9.5, and avoiding backpatching this part can only lead to confusion in the future. * Some minor tweaks to tuplesort.c. Make sure that tuplesort_putdatum() zeroes datum1 directly for NULL values. Comment tweaks. * Add comment to the datum case, discussing restriction there. I was wrong when I said that the datum sort case currently tacitly acknowledges as possible/useful something that the revised SortSupport contract will forbid (I wrote that e-mail in haste). What I propose to make the SortSupport contract forbid here is abbreviated keys that are *themselves* pass-by-reference. It is true that today, we do not support pass-by-value types with abbreviated keys for the datum case only (such opclass support could be slightly useful for float8, for example -- int8 comparisons of an alternative representation might be decisively cheaper). But that existing restriction is entirely distinct to the new restriction I propose to create. It seems like this distinction should be pointed out in passing, which I've done. -- Peter Geoghegan
Вложения
В списке pgsql-hackers по дате отправления: