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

From Magnus Hagander
Subject Re: pgsql: Teach tuplesort.c about "top N" sorting, in which only the first
Date
Msg-id 20070504164735.GF30617@svr2.hagander.net
Whole thread Raw
In response to Re: pgsql: Teach tuplesort.c about "top N" sorting, in which only the first  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-committers
On Fri, May 04, 2007 at 12:38:18PM -0400, Tom Lane wrote:
> Magnus Hagander <magnus@hagander.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.

Now that you mention it, that'd be nice to have as well - the point being
making it available without recompile.

> 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.

Hmm. Ok. Don't know enough about those parts of the code to comment on
that, but I'll certainly take your word for it :-)

//Magnus


pgsql-committers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: pgsql: Teach tuplesort.c about "top N" sorting, in which only the first
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Add a line to the EXPLAIN ANALYZE output for a Sort node, showing