I noticed a small bug in the "Sort Method" code:
postgres=# explain analyze select * from test order by random() limit 1;
QUERY PLAN
Gregory Stark <[EMAIL PROTECTED]> 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
I wrote:
> Hmm. Actually, given that sort_bounded_heap() is only conditionally
> invoked, *both* of the state updates it makes are bogus.
Er, make that three state updates: its REVERSEDIRECTION() operation is
being skipped as well. That's not critical now, but might be someday.
Rather than movi
"Tom Lane" <[EMAIL PROTECTED]> 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 s