Re: [GENERAL] Access to postgresql query optimizer output

2012-10-29 Thread Craig Ringer
On 10/30/2012 12:33 AM, Peter Geoghegan wrote: > On 29 October 2012 16:00, Jeff Janes wrote: >> The re-writing does not occur at the level of SQL, but rather at the >> level of an internal representation "parse tree". > > Right. The post parse-analysis tree (i.e. the Query struct) is > potentiall

Re: [GENERAL] Access to postgresql query optimizer output

2012-10-29 Thread Peter Geoghegan
On 29 October 2012 16:00, Jeff Janes wrote: > The re-writing does not occur at the level of SQL, but rather at the > level of an internal representation "parse tree". Right. The post parse-analysis tree (i.e. the Query struct) is potentially rewritten by an explicit rewrite stage after parse-anal

Re: [GENERAL] Access to postgresql query optimizer output

2012-10-29 Thread Tom Lane
Jeff Janes writes: > On Mon, Oct 29, 2012 at 1:07 AM, Seref Arikan > wrote: >> 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? I

Re: [GENERAL] Access to postgresql query optimizer output

2012-10-29 Thread Jeff Janes
On Mon, Oct 29, 2012 at 1:07 AM, Seref Arikan 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 > m

Re: [GENERAL] Access to postgresql query optimizer output

2012-10-29 Thread Seref Arikan
Thanks for the clarification Craig. On Mon, Oct 29, 2012 at 8:46 AM, Craig Ringer wrote: > On 10/29/2012 04:07 PM, Seref Arikan 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 fo

Re: [GENERAL] Access to postgresql query optimizer output

2012-10-29 Thread Craig Ringer
On 10/29/2012 04:07 PM, Seref Arikan 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

[GENERAL] Access to postgresql query optimizer output

2012-10-29 Thread Seref Arikan
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 t