pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Steven Rosenstein <srosenst@us.ibm.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Can the V7.3 EXPLAIN ANALYZE be trusted?
Date: Sun, 06 Feb 2005 17:46:05 -0500
Message-ID: <17152.1107729965@sss.pgh.pa.us> (raw)
In-Reply-To: <BF88DF69D9E2884B9BE5160DB2B97A85010D7046@nlshl-exch1.eu.uis.unisys.com>
References: <BF88DF69D9E2884B9BE5160DB2B97A85010D7046@nlshl-exch1.eu.uis.unisys.com>

> From: pgsql-performance-owner@postgresql.org [mailto:pgsql-performance-owner@postgresql.org]On Behalf Of Steven Rosenstein
> >> I don't think EXPLAIN ANALYZE puts that much overhead on a query.

I think you're being overly optimistic.  The explain shows that the
Materialize subnode is being entered upwards of 32 million times:

   ->  Materialize  (cost=505.06..511.38 rows=632 width=4) (actual time=0.00..0.02 rows=43 loops=752066)

43 * 752066 = 32338838.  The instrumentation overhead is basically two
gettimeofday() kernel calls per node entry.  Doing the math shows that
your machine is able to do gettimeofday() in about half a microsecond,
which isn't stellar but it's not all that slow for a kernel call.
(What's the platform here, anyway?)  Nonetheless it's a couple of times
larger than the actual time needed to pull a row from a materialized
array ...

The real answer to your question is "IN (subselect) sucks before PG 7.4;
get a newer release".

			regards, tom lane



view thread (6+ messages)  latest in thread

Message-ID: <17152.1107729965@sss.pgh.pa.us>
Permalink:  ../17152.1107729965@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17152.1107729965@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, srosenst@us.ibm.com
  Subject: Re: Can the V7.3 EXPLAIN ANALYZE be trusted?
  In-Reply-To: <17152.1107729965@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