pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Vamsidhar Thummala <vamsi@cs.duke.edu>
Cc: pgsql-performance@postgresql.org
Subject: Re: Hash Join performance
Date: Fri, 13 Mar 2009 17:34:38 -0400
Message-ID: <18410.1236980078@sss.pgh.pa.us> (raw)
In-Reply-To: <e0e3da5e0903131415k38dc870bo15c6ad2625cd922b@mail.gmail.com>
References: <e0e3da5e0903131407k75ca87a4j5c7dcc360805d5c1@mail.gmail.com>
	<e0e3da5e0903131415k38dc870bo15c6ad2625cd922b@mail.gmail.com>

Vamsidhar Thummala <vamsi@cs.duke.edu> writes:
> 1) The actual time on Seq Scan on Lineitem shows that the first record is
> fetched at time 0.022ms and the last record is fetched at 53.5s. Does it
> mean the sequential scan is completed with-in first 53.4s (absolute time)?

No, it means that we spent a total of 53.5 seconds executing that plan
node and its children.  There's no direct way to determine how that was
interleaved with the execution of a peer plan node.  In the particular
case here, since that seqscan is the outer child of a hash join, you
can infer that all the time charged to the inner child (the Hash node
and its children) happened first, while we were building the hashtable,
which is then probed for each row of the outer relation.

> 2) Why is the Hash Join (top most) so slow?

Doesn't look that bad to me.  The net time charged to the HashJoin node
is 186107.210 - 53597.555 - 112439.592 = 20070.063 msec.  In addition it
would be reasonable to count the hashtable build time, which evidently
is 112439.592 - 111855.510 = 584.082 msec.  So the hashtable build took
about 10 msec/row, in addition to the data fetching; and then the actual
join spent about 3 microsec per outer row, again exclusive of obtaining
those rows.  The table build seems a bit slow, maybe, but I don't see a
problem with the join speed.

			regards, tom lane



view thread (5+ messages)  latest in thread

Message-ID: <18410.1236980078@sss.pgh.pa.us>
Permalink:  ../18410.1236980078@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18410.1236980078@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, vamsi@cs.duke.edu
  Subject: Re: Hash Join performance
  In-Reply-To: <18410.1236980078@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