Re: Buglet in "Sort Method" explain output in degenerate case

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Buglet in "Sort Method" explain output in degenerate case
Дата
Msg-id 878x7qjev5.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: Buglet in "Sort Method" explain output in degenerate case  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> Setting it at conclusion is correct, I think, since if we ever changed
> the code to abandon TSS_BOUNDED state in the face of unexpected memory
> growth, it would be wrong to have set it in make_bounded_sort.

Actually that would be pretty easy to do and strikes me as worth doing. It
isn't hard to contrive an example that over-runs work_mem though I'm not sure
how easy it would be to actually run out of RAM.

One thing though, we would have to let up on switching to bounded sort if we
run out of memory accumulating tuples. We wouldn't want to switch to bounded
sort and then spill to disk right afterward. Here I just added 10% assuming
usually the remaining tuples won't be 10% larger than the first batch.
Introducing floating point math in here kind of bothers me though.




--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Buglet in "Sort Method" explain output in degenerate case
Следующее
От: Tom Lane
Дата:
Сообщение: WIP patch for per-function GUC settings