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

From Tom Lane
Subject Re: pgsql: Teach tuplesort.c about "top N" sorting, in which only the first
Date
Msg-id 4005.1178296698@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Teach tuplesort.c about "top N" sorting, in which only the first  (Magnus Hagander <magnus@hagander.net>)
Responses Re: pgsql: Teach tuplesort.c about "top N" sorting, in which only the first
Re: pgsql: Teach tuplesort.c about "top N" sorting, in which only the first
List pgsql-committers
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.
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

pgsql-committers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: pgsql: Teach tuplesort.c about "top N" sorting, in which only the first
Next
From: Gregory Stark
Date:
Subject: Re: pgsql: Teach tuplesort.c about "top N" sorting, in which only the first