Re: [COMMITTERS] pgsql: Teach tuplesort.c about "top N" sorting, in which only the first - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [COMMITTERS] pgsql: Teach tuplesort.c about "top N" sorting, in which only the first
Date
Msg-id 11029.1178314765@sss.pgh.pa.us
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Teach tuplesort.c about "top N" sorting, in which only the first  (Stefan Kaltenbrunner <stefan@kaltenbrunner.cc>)
List pgsql-hackers
Stefan Kaltenbrunner <stefan@kaltenbrunner.cc> writes:
> Guillaume Smet wrote:
>> On 5/4/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> Sort Method: disk  Memory: 1000KB  Disk: 18482KB
>> 
>> +1 for this one.

> I like that one too ...

OK, in the event it looks like one of these four messages:
 "Sort Method:  top-N heapsort  Memory: %ldkB" "Sort Method:  quicksort  Memory: %ldkB" "Sort Method:  external sort
Disk:%ldkB" "Sort Method:  external merge  Disk: %ldkB"
 

where "external merge" implies that the final merge pass was done
on-the-fly instead of materializing the fully sorted data on disk.
I'm not wedded to these method descriptions if anyone has better phrases
in mind.

Also, I tried to make the disk cases print disk and memory usage both,
but was getting wacko numbers for memory usage.  I had forgotten that
the disk-sort path doesn't bother to track memory usage accurately once
it starts returning tuples to the caller (since at that point all the
decisions are made).  I'm not really excited about fixing that; it
would add per-tuple overhead for not much value.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] Removing pg_auth_members.grantor (was Grantor name gets lost when grantor role dropped)
Next
From: Stephen Frost
Date:
Subject: Re: [BUGS] Removing pg_auth_members.grantor (was Grantor name gets lost when grantor role dropped)