pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-sql@postgresql.org
Subject: Re: Using EXPLAIN-ANALYZE
Date: Thu, 16 Feb 2006 15:39:23 -0500
Message-ID: <20060216203923.GA9872@phlogiston.dyndns.org> (raw)
In-Reply-To: <18AE59788A3FC640A367E5652E664D80019287F0@xmb-sjc-237.amer.cisco.com>
References: <18AE59788A3FC640A367E5652E664D80019287F0@xmb-sjc-237.amer.cisco.com>

On Thu, Feb 16, 2006 at 12:07:10PM -0800, Kashmira Patel (kupatel) wrote:
> Hi all,
>    I am pretty new to using Postrgres, and have been looking at the
> messages in this forum for a while. I have noticed that the use of
> EXPLAIN-ANALYZE is recommended quite a lot. I read the Postgres docs,
> but am not quite sure I understand how this works. Is there some
> tutorial or any other documentation how this can be used?

Well, here's the short version:

EXPLAIN [query] tells you what the planner _thinks_ it should do.

EXPLAIN ANALYZE [query] tells you what the planner thinks it should
do, and also executes the query and reports back how long every step
took, how many rows were returned, &c.  (For this reason, you want to
wrap it in BEGIN;...;ROLLBACK; if it changes data.)

For more, see the EXPLAIN EXPLAINED tutorial on
techdocs.postgresql.org
(<http://techdocs.postgresql.org/oscon2005/robert.treat/OSCON_Explaining_Explain_Public.sxi;)

A

-- 
Andrew Sullivan  | ajs@crankycanuck.ca
In the future this spectacle of the middle classes shocking the avant-
garde will probably become the textbook definition of Postmodernism. 
                --Brad Holland



view thread (7+ messages)  latest in thread

Message-ID: <20060216203923.GA9872@phlogiston.dyndns.org>
Permalink:  ../20060216203923.GA9872@phlogiston.dyndns.org/
Also on:    postgresql.org/message-id/20060216203923.GA9872@phlogiston.dyndns.org

 · 

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-sql@postgresql.org
  Cc: ajs@crankycanuck.ca
  Subject: Re: Using EXPLAIN-ANALYZE
  In-Reply-To: <20060216203923.GA9872@phlogiston.dyndns.org>

* 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