Re: memory context for tuplesort return values

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: memory context for tuplesort return values
Дата
Msg-id 3970.1140799907@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: memory context for tuplesort return values  (Simon Riggs <simon@2ndquadrant.com>)
Список pgsql-hackers
Simon Riggs <simon@2ndquadrant.com> writes:
> On Thu, 2006-02-23 at 16:10 -0500, Tom Lane wrote:
>> I don't want to give up the idea of keeping sort-local data in a
>> private
>> context --- it just seems cleaner, as well as faster, than letting it
>> be
>> mixed into the caller's stuff.  I can see two alternatives:

> Would that be a single context for all sort operations, or a separate
> context for each sort within a plan?

A private context for each sort operation.  Otherwise you lose the
point, which is to be able to use MemoryContextDelete to clean up
in tuplesort_end.

> There is some evidence that high sort memory is not that useful during
> the final merge phase. Would it be possible to have multiple contexts
> within each sort e.g. Run Forming context and Final Merge context? That
> would then allow us to more easily free the Run Forming context before
> moving into the final context with a potentially different size.

Possible, but I'm not going to implement it without more evidence.
The tests I did way back when showed considerable usefulness for the
merge preload behavior, and I think that your change to allow N tapes
probably made it even more useful (because with fewer merge passes,
the tape files don't get so disorganized).  So I'm inclined to leave it
as-is.
        regards, tom lane


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

Предыдущее
От: "Jonah H. Harris"
Дата:
Сообщение: Re: Remove ora2pg from contrib
Следующее
От: Rod Taylor
Дата:
Сообщение: Re: fsutil ideas