Re: More ideas for speeding up sorting

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: More ideas for speeding up sorting
Дата
Msg-id CAM3SWZRBNJML7RKQOAxPJmz7nYHavu5itHfJURedJee=JHLsiQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: More ideas for speeding up sorting  (Peter Geoghegan <pg@heroku.com>)
Список pgsql-hackers
On Fri, Sep 9, 2016 at 1:54 PM, Peter Geoghegan <pg@heroku.com> wrote:
>> 2. We could easily categorize incoming tuples as the come in, into those
>> that have a leading NULL, and others. If we kept them in separate arrays, or
>> perhaps grow memtuples from bottom-up for non-NULLs and from top-down for
>> NULLs, we wouldn't need to store, or compare, the 'isnull1' flag at all, in
>> the quicksort.'
>
> We also wouldn't need to use datum1 to store nothing, at least in the
> "state.tuples" (non-datum-pass-by-value) case. Where the leading
> attribute is NULL, we can "discard" it, and sort those tuples
> separately, and return them to caller first or last as required.

Another thing: ApplySortComparator() (but not
ApplySortAbbrevFullComparator()) is now under no obligation to care
about NULL values, since that happens out-of-band for the leading
attribute. (Actually, you'd need to create a new variation for the
leading attribute only, since we reuse ApplySortComparator() for
non-leading attributes, but that might be yet another win that this
leads to.)

-- 
Peter Geoghegan



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: More ideas for speeding up sorting
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re: GiST optimizing memmoves in gistplacetopage for fixed-size updates [PoC]