Re: Convert query plan to sql query

From: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>
To: mariem <mariem(dot)benfadhel(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Convert query plan to sql query
Date: 2014-11-05 04:36:10
Message-ID: CAFjFpRczRiBoLsqqXUvsV2t0pDFCK5zhwRVhgA9t+RCT5DA+xw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

May be you want to check how it's done in Postgres-XC. Postgres-XC works on
plans being created by PostgreSQL and "reverse-engineers" queries (for
parts of the plans which are "shippable".) The notions of "shippability"
may not be of interest to you, but the code to "reverse-engineer" most of
the plan nodes is there in Postgres-XC.

On Wed, Nov 5, 2014 at 8:47 AM, mariem <mariem(dot)benfadhel(at)gmail(dot)com> wrote:

> Hello,
>
> I would like to transform the query plan (output of the planner,
> debug_print_plan) into an sql query.
> I know that there are pieces of the query plan that might be machine
> dependent (in var for example).
> So I wanted to have your suggestions or thoughts before I put efforts into
> it.
>
> Basically, if I have:
> query1 -> parser -> rewriter -> planner
> the process would be :
> query_plan -> planner -> parser -> query2
>
> query1 and query2 are not necessarily the same due to rewrite, stats..
>
> Thanks!
>
>
>
>
> --
> View this message in context:
> http://postgresql.1045698.n5.nabble.com/Convert-query-plan-to-sql-query-tp5825727.html
> Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2014-11-05 05:19:11 Re: Let's drop two obsolete features which are bear-traps for novices
Previous Message Michael Paquier 2014-11-05 03:50:53 Re: WAL replay bugs