pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: John Arbash Meinel <john@arbash-meinel.com>
Cc: Joel Fradkin <jfradkin@wazagua.com>
Cc: PostgreSQL Perform <pgsql-performance@postgresql.org>
Subject: Re: Any way to speed this up?
Date: Thu, 07 Apr 2005 12:13:48 -0400
Message-ID: <3393.1112890428@sss.pgh.pa.us> (raw)
In-Reply-To: <42555396.40303@arbash-meinel.com>
References: <005301c53b84$6b83f8a0$797ba8c0@jfradkin>
	<42555396.40303@arbash-meinel.com>

John Arbash Meinel <john@arbash-meinel.com> writes:
>> "  ->  Sort  (cost=59478.03..59909.58 rows=172618 width=75) (actual
>> time=46844.000..46985.000 rows=159960 loops=1)"
>> 
>> "        Sort Key: a.locationid"
>> 

> This sort actually isn't taking very long. It starts at 46800 and runs
> until 47000 so it takes < 1 second.

>> "        ->  Merge Right Join  (cost=0.00..39739.84 rows=172618
>> width=75) (actual time=250.000..43657.000 rows=176431 loops=1)"

You're not reading it quite right.  The first "actual" number is the
time at which the first result row was delivered, which for a sort is
after the completion of (the bulk of) the sorting work.  What you
really need to look at is the difference between the completion times
of the node and its immediate input(s).  In this case I'd blame the
sort for 46985.000 - 43657.000 msec.

Come to think of it, though, you should not be putting a whole lot of
trust in EXPLAIN ANALYZE numbers taken on Windows, because they are
based on gettimeofday which has absolutely awful resolution on that
platform.  (There's a workaround for this in our CVS, but it's not in
8.0.*.)  I think we can still conclude that the indexscan on
tblassociate is most of the cost, but I wouldn't venture to say that
it's exactly such-and-such percent.

			regards, tom lane



view thread (11+ messages)  latest in thread

Message-ID: <3393.1112890428@sss.pgh.pa.us>
Permalink:  ../3393.1112890428@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3393.1112890428@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, john@arbash-meinel.com, jfradkin@wazagua.com
  Subject: Re: Any way to speed this up?
  In-Reply-To: <3393.1112890428@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox