pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: CoL <col@mportal.hu>
To: pgsql-admin@postgresql.org
Subject: Re: PostgreSQL: query optimizer: viewing query plans
Date: Thu, 18 Dec 2003 11:15:44 +0100
Message-ID: <brrunf$2j7n$1@news.hub.org> (raw)
In-Reply-To: <b68d2f19.0312172223.21c3f24b@posting.google.com>
References: <b68d2f19.0312172223.21c3f24b@posting.google.com>

Hi,

Neil Zanella wrote:

> Hello,
> 
> Several textbooks talk about query trees and query plans including the following
> relatively recent book <http://www.oreilly.com/catalog/sqltuning/; which covers
> how to apply performance tuning techniques by using knowledge about the query 
> optimizer to rewrite SQL queries so that they get interpreted more efficiently.
> 
> Unfortunately the book only shows how to view the query plan associated witht the
> given query for Oracle, IBM DB2, and MS SQL Server. I wonder whether PostgreSQL
> also has a way to let the user see the heuristically computed query plan created
> by the query optimizer. Is it possible to view query plans with PostgreSQL server
> and its related command line interfaces? How would I run such a command?

explain query
explain analyze query

and you can set logging in postgres.conf, and you can log 
debug_print_XXX  things (xxx like parse, rewritten query, the plan)

C.



view thread (2+ messages)

Message-ID: <brrunf$2j7n$1@news.hub.org>
Permalink:  ../brrunf$2j7n$1@news.hub.org/
Also on:    postgresql.org/message-id/brrunf$2j7n$1@news.hub.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: col@mportal.hu
  Subject: Re: PostgreSQL: query optimizer: viewing query plans
  In-Reply-To: <brrunf$2j7n$1@news.hub.org>
  References: <b68d2f19.0312172223.21c3f24b@posting.google.com> <brrunf$2j7n$1@news.hub.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