[PATCHES] Buglet in Sort Method explain output in degenerate case

2007-09-01 Thread Gregory Stark
I noticed a small bug in the Sort Method code: postgres=# explain analyze select * from test order by random() limit 1; QUERY PLAN

Re: [PATCHES] Buglet in Sort Method explain output in degenerate case

2007-09-01 Thread Tom Lane
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

Re: [PATCHES] Buglet in Sort Method explain output in degenerate case

2007-09-01 Thread Tom Lane
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