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 5382.1178303367@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  (Jim Nasby <decibel@decibel.org>)
Responses Re: [COMMITTERS] pgsql: Teach tuplesort.c about "top N" sorting, in which only the first
List pgsql-hackers
Jim Nasby <decibel@decibel.org> writes:
> If the method is disk it would be nice to know how much spilled to  
> disk. That would tell you if it would be worth increasing work_mem,  
> and by how much.

Well, a more radical proposal is to add a whole 'nother line to the
output, which would give us room for several bits of info.  Perhaps
like this:
  ->  Sort  (cost=840.19..865.19 rows=10000 width=244) (actual time=151.769..152.157 rows=100 loops=1)        Sort Key:
fivethous       Sort Method: top-N  Memory: 17KB        ->  Seq Scan on tenk1  (cost=0.00..458.00 rows=10000 width=244)
(actual

or
        Sort Method: disk  Memory: 1000KB  Disk: 18482KB

Not sure what other info might be useful.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Treat
Date:
Subject: Re: Feature freeze progress report
Next
From: Dave Page
Date:
Subject: Re: RETURN QUERY in PL/PgSQL?