Re: sortsupport for text

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: sortsupport for text
Дата
Msg-id 28784.1339777376@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: sortsupport for text  (Peter Geoghegan <peter@2ndquadrant.com>)
Ответы Re: sortsupport for text  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Peter Geoghegan <peter@2ndquadrant.com> writes:
> On 14 June 2012 19:28, Robert Haas <robertmhaas@gmail.com> wrote:
>> I thought that doubling repeatedly would be overly aggressive in terms
>> of memory usage.

> I fail to understand how this sortsupport buffer fundamentally differs
> from a generic dynamic array abstraction built to contain chars. That
> being the case, I see no reason not to just do what everyone else does
> when expanding dynamic arrays, and no reason why we shouldn't make
> essentially the same time-space trade-off here as others do elsewhere.

I agree with Peter on this one; not only is double-each-time the most
widespread plan, but it is what we do in just about every other place
in Postgres that needs a dynamically expansible buffer.  If you do it
randomly differently here, readers of the code will be constantly
stopping to wonder why it's different here and if that's a bug or not.
(And from a performance standpoint, I'm not entirely convinced it's not
a bug, anyway.  Worst-case behavior could be pretty bad.)
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: COMMENT on function's arguments
Следующее
От: Robert Haas
Дата:
Сообщение: Re: sortsupport for text