Re: Access to postgresql query optimizer output - Mailing list pgsql-general

From Jeff Janes
Subject Re: Access to postgresql query optimizer output
Date
Msg-id CAMkU=1wYuqyPsX4just8LFWidUbWMrKa=qE16+QuWKf33bqZ2g@mail.gmail.com
Whole thread Raw
In response to Access to postgresql query optimizer output  (Seref Arikan <serefarikan@kurumsalteknoloji.com>)
Responses Re: Access to postgresql query optimizer output  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Access to postgresql query optimizer output  (Peter Geoghegan <peter@2ndquadrant.com>)
List pgsql-general
On Mon, Oct 29, 2012 at 1:07 AM, Seref Arikan
<serefarikan@kurumsalteknoloji.com> wrote:
> Greetings,
> I keep seeing statements like "Postgresql optimizer rewrites this query
> as...." What I'm curious about is, is there a way to obtain SQL form of the
> re-written queries somewhere in the chain of query evaluation? It does not
> make a lot sense to generate sql again, but it would help a lot to see  the
> queries in their  rewritten form.

The re-writing does not occur at the level of SQL, but rather at the
level of an internal representation "parse tree".

You can see these representations using these configuration settings;

debug_print_parse = on
debug_print_rewritten = on

I'm not aware of anything that turns those back into SQL.

Cheers,

Jeff


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: How to print application_name in log_line_prefix (using %a)?
Next
From: Jeff Janes
Date:
Subject: Re: How to print application_name in log_line_prefix (using %a)?