Re: [HACKERS] Convert query plan to sql query

2014-11-10 Thread mariem
simplification phases and constant-folding before transforming the query tree back to sql text query. Thank you for the suggestions. Best, Mariem -- View this message in context: http://postgresql.nabble.com/Convert-query-plan-to-sql-query-tp5825727p5826448.html Sent from the PostgreSQL - hackers

Re: [HACKERS] Convert query plan to sql query

2014-11-07 Thread mariem
, and occasionally in minor releases. You should read the git history of explain.c and ruleutils.c and ask yourself whether you want to keep up with that level of churn. I'm aware of ruleutils.c which I think is a good tool but I don't think it's appropriate as it takes the parse tree as input. Best, Mariem

Re: [HACKERS] Convert query plan to sql query

2014-11-05 Thread mariem
wrote: I don't think SQL can express the information the plan contains. For example, join methods (hash, nest loop, merge). I don't need the way the query will be executed, so there is no need for (hash, nest loop, merge). -- View this message in context:

Re: [HACKERS] Convert query plan to sql query

2014-11-05 Thread mariem
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

[HACKERS] Convert query plan to sql query

2014-11-04 Thread mariem
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.