Re: Buglet in "Sort Method" explain output in degenerate case
От | Tom Lane |
---|---|
Тема | Re: Buglet in "Sort Method" explain output in degenerate case |
Дата | |
Msg-id | 22961.1188670793@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Buglet in "Sort Method" explain output in degenerate case (Gregory Stark <stark@enterprisedb.com>) |
Ответы |
Re: Buglet in "Sort Method" explain output in degenerate case
Re: Buglet in "Sort Method" explain output in degenerate case |
Список | pgsql-patches |
Gregory Stark <stark@enterprisedb.com> writes: > It's printing "quicksort" even though it used a heap. This happens because we > don't bother deheapifying a singleton heap so the boundUsed flag never gets > set. The patch below just moves setting that flag to when the heap is made > instead of when it's deheapified. Hmm. Actually, given that sort_bounded_heap() is only conditionally invoked, *both* of the state updates it makes are bogus. But I think they should both be done at the call site in tuplesort_performsort. (The state->status update already is, which is why it works at all.) 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. regards, tom lane
В списке pgsql-patches по дате отправления: