Re: Access to postgresql query optimizer output
От
Seref Arikan
Тема
Re: Access to postgresql query optimizer output
Дата
Msg-id
CA+4Thdpctou=3hPczB++=S+wKx18Jv2Mp4AtOabbxU3s1Ddhbw@mail.gmail.com
Ответ на
Re: Access to postgresql query optimizer output (Craig Ringer)
Список
Дерево обсуждения
Access to postgresql query optimizer output Seref Arikan <serefarikan@kurumsalteknoloji.com>
Re: Access to postgresql query optimizer output Craig Ringer <ringerc@ringerc.id.au>
Re: Access to postgresql query optimizer output Seref Arikan <serefarikan@kurumsalteknoloji.com>
Re: Access to postgresql query optimizer output Jeff Janes <jeff.janes@gmail.com>
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>
Re: Access to postgresql query optimizer output Craig Ringer <ringerc@ringerc.id.au>
Thanks for the clarification Craig.
On Mon, Oct 29, 2012 at 8:46 AM, Craig Ringer <ringerc@ringerc.id.au> wrote:
I've never seen such a tool, and I'm not sure one is possible, though IOn 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 sense to generate sql again, but it would help a lot
> to see the queries in their rewritten form.
agree it'd be interesting.
The same SQL can result in many different query plans, and there are
many different SQL statements that can all result in the same query
plan. How would you unambiguously show what plan the SQL represented?
It's not so much that Pg's planner "rewrites" one SQL statement to
another. Usually, it's that two or more different SQL statements
optimize down to the same query plan.
EXPLAIN and EXPLAIN ANALYZE show the query plans, and I'm not really
sure you can go backwards from there to SQL in any consistent and
logical way.
--
Craig Ringer
В списке pgsql-general по дате отправления