Re: Is tuplesort_heap_siftup() a misnomer?

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Is tuplesort_heap_siftup() a misnomer?
Дата
Msg-id CAM3SWZSeRSDu4=8mhq8E5zMTDAUfAmW+tc6xsYO5p5cD7DwWnA@mail.gmail.com
обсуждение исходный текст
Ответ на Is tuplesort_heap_siftup() a misnomer?  (Peter Geoghegan <pg@heroku.com>)
Ответы Re: Is tuplesort_heap_siftup() a misnomer?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Fri, Aug 12, 2016 at 4:30 PM, Peter Geoghegan <pg@heroku.com> wrote:
> Doesn't tuplesort_heap_siftup() actually shift-down?
>
> The Wikipedia article on heaps [1] lists "shift-down" (never "sift
> down", FWIW) as a common operation on a heap:
>
> "shift-down: move a node down in the tree, similar to shift-up; used
> to restore heap condition after deletion or replacement."
>
> This seems to be what tuplesort_heap_siftup() actually does (among
> other things; its job is to compact the heap following caller
> returning the root, where caller leaves a "hole" at the root position
> 0).

Heikki (CC'd) and I discussed this privately today, and we were in
agreement that this needs to be fixed, so I wrote a patch, which I
attach here.


--
Peter Geoghegan

Вложения

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

Предыдущее
От: Corey Huinker
Дата:
Сообщение: Re: \timing interval
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: GiST penalty functions [PoC]