pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PostgreSQL: query optimizer: viewing query plans
2+ messages / 2 participants
[nested] [flat]

* PostgreSQL: query optimizer: viewing query plans
@ 2003-12-18 06:23 Neil Zanella <nzanella@cs.mun.ca>
  2003-12-18 10:15 ` Re: PostgreSQL: query optimizer: viewing query plans CoL <col@mportal.hu>
  0 siblings, 1 reply; 2+ messages in thread

From: nzanella@cs.mun.ca @ 2003-12-18 06:23 UTC (permalink / raw)
  To: pgsql-admin

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?

Thanks,

Neil



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: PostgreSQL: query optimizer: viewing query plans
  2003-12-18 06:23 PostgreSQL: query optimizer: viewing query plans Neil Zanella <nzanella@cs.mun.ca>
@ 2003-12-18 10:15 ` CoL <col@mportal.hu>
  0 siblings, 0 replies; 2+ messages in thread

From: CoL @ 2003-12-18 10:15 UTC (permalink / raw)
  To: pgsql-admin

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.



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-12-18 10:15 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-12-18 06:23 PostgreSQL: query optimizer: viewing query plans Neil Zanella <nzanella@cs.mun.ca>
2003-12-18 10:15 ` CoL <col@mportal.hu>

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