External Sort timing debug statements

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: External Sort timing debug statements
Date: 2005-10-02 18:43:17
Message-ID: 1128278598.8603.10.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

The following patch implements a fairly light set of timing statements
aimed at understanding external sort performance. There is no attempt to
alter the algorithms.

Each major point in the algorithms is marked as shown in this example:

postgres=# set debug_sort=true;
SET

postgres=# explain analyze select * from test2 order by col1,col2;

NOTICE: tuplesort begin work_mem= 1024
NOTICE: +0 secs heap sort nkeys= 2
NOTICE: +0 secs switching to external sort
NOTICE: +1129 secs starting build of next run
NOTICE: +2229 secs run building complete nruns= 2
NOTICE: +2229 secs merging runs with 6 tapes

...

NOTICE: +3036 secs starting final merge

I'll add other information, as requested.

The "6 tapes" is currently hardcoded, though is included in expectation
of implementing variable numbers of tapes.

I'm not sure if I got the header file correct for full portability of
gettimeofday(). Please correct me, if this is the case.

Please post sort performance data back via this post.

Best Regards, Simon Riggs

Attachment Content-Type Size
debug_sort.patch text/x-patch 6.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2005-10-02 19:38:43 Re: [PERFORM] A Better External Sort?
Previous Message mark 2005-10-02 18:25:53 Re: effective SELECT from child tables

Browse pgsql-patches by date

  From Date Subject
Next Message Qingqing Zhou 2005-10-02 18:52:22 database file compatibility patch
Previous Message Thomas Hallgren 2005-10-02 17:39:09 Re: Path to enable a module to change the stack_base_ptr