Re: Ordered Append Node

Поиск
Список
Период
Сортировка
От Csaba Nagy
Тема Re: Ordered Append Node
Дата
Msg-id 1195823021.27060.114.camel@PCD12478
обсуждение исходный текст
Ответ на Re: Ordered Append Node  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-hackers
On Fri, 2007-11-23 at 12:36 +0000, Gregory Stark wrote:
> I also did an optimization similar to the bounded-sort case where we check if
> the next tuple from the same input which last contributed the result record
> comes before the top element of the heap. That avoids having to do an insert
> and siftup only to pull out the same record you just inserted. In theory this
> is not an optimization but in practice I think partitioned tables will often
> contain contiguous blocks of key values and queries will often be joining
> against that key and therefore often want to order by it.

If it is an option, you could also do this by a new method on the heap
which adds a new entry and removes the resulting new head in one atomic
operation. That would work with one single comparison for the less than
current head situation, and it would not need to repeat that comparison
if that fails. Also it could directly remove the head and balance the
tree in one go.

Cheers,
Csaba.




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

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: Ordered Append Node
Следующее
От: Markus Schiltknecht
Дата:
Сообщение: Re: Ordered Append Node