Re: 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: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Teach tuplesort.c about "top N" sorting, in which only the first
Date: 2007-05-04 16:38:18
Message-ID: 4005.1178296698@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Magnus Hagander <magnus(at)hagander(dot)net> writes:
> Could we show it in EXPLAIN ANALYZE somehow? I'm thinking it would be good
> to see at runtime (for example as a hint that if you put in a bit more
> work_mem it might get used)

I don't see that this is any more interesting than whether the sort
spilled to disk or not; which is something we don't show in EXPLAIN
ANALYZE either. trace_sort is the agreed API for examining that.
It's not exactly easy to do, because (a) none of this information
is exposed outside tuplesort.c, and (b) the tuplesortstate object
is probably gone by the time EXPLAIN ANALYZE runs, anyway.

regards, tom lane

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Gregory Stark 2007-05-04 16:46:54 Re: pgsql: Teach tuplesort.c about "top N" sorting, in which only the first
Previous Message Magnus Hagander 2007-05-04 16:26:38 Re: pgsql: Teach tuplesort.c about "top N" sorting, in which only the first

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-05-04 16:41:29 Re: Grantor name gets lost when grantor role dropped
Previous Message Alvaro Herrera 2007-05-04 16:34:01 Re: Grantor name gets lost when grantor role dropped