Skip site navigation (1) Skip section navigation (2)

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

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Magnus Hagander" <magnus(at)hagander(dot)net>, <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:46:54
Message-ID: 87fy6cilj5.fsf@oxford.xeocode.com (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

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

It would be positively wonderful to see whether the sort spilled to disk in
the explain analyze. Could we make putting more feedback about sorts in
EXPLAIN ANALYZE output a TODO?

-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com


In response to

Responses

pgsql-hackers by date

Next:From: Magnus HaganderDate: 2007-05-04 16:47:35
Subject: Re: pgsql: Teach tuplesort.c about "top N" sorting, in which only the first
Previous:From: Tom LaneDate: 2007-05-04 16:41:29
Subject: Re: Grantor name gets lost when grantor role dropped

pgsql-committers by date

Next:From: Magnus HaganderDate: 2007-05-04 16:47:35
Subject: Re: pgsql: Teach tuplesort.c about "top N" sorting, in which only the first
Previous:From: Tom LaneDate: 2007-05-04 16:38:18
Subject: Re: pgsql: Teach tuplesort.c about "top N" sorting, in which only the first

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group