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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jim Nasby <decibel(at)decibel(dot)org>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Teach tuplesort.c about "top N" sorting, in which only the first
Date: 2007-05-04 18:29:27
Message-ID: 5382.1178303367@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Jim Nasby <decibel(at)decibel(dot)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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Guillaume Smet 2007-05-04 18:44:07 Re: [COMMITTERS] pgsql: Teach tuplesort.c about "top N" sorting, in which only the first
Previous Message Josh Berkus 2007-05-04 17:54:52 Re: [COMMITTERS] pgsql: Teach tuplesort.c about "top N" sorting, in which only the first

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2007-05-04 18:38:37 Re: RETURN QUERY in PL/PgSQL?
Previous Message Robert Treat 2007-05-04 18:24:21 Re: Feature freeze progress report