Re: Planner debug views - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Planner debug views
Date
Msg-id 25538.1438119787@sss.pgh.pa.us
Whole thread Raw
In response to Re: Planner debug views  (Qingqing Zhou <zhouqq.postgres@gmail.com>)
Responses Re: Planner debug views
List pgsql-hackers
Qingqing Zhou <zhouqq.postgres@gmail.com> writes:
> Not sure if I got it: so EXPLAIN will return tuples to libpq client. But
> how do we store these returned tuples (RelOptInfo, Path etc) so we can
> throw queries against them later?

> Something like this:
> INSERT INTO my_space SELECT (EXPLAIN SELECT ...); -- won't get parsed

You can do something like that in plpgsql, for example
   declare t text;
   for t in EXPLAIN SELECT ...   loop      insert into whatever values(t);   end loop;

There's an example of doing this sort of thing in the brin.sql regression
test, where it's used to verify that we're getting the plan type we
expect.

I don't feel a strong need to invent additional forms of that wheel.
        regards, tom lane



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: WIP: Make timestamptz_out less slow.
Next
From: Tom Lane
Date:
Subject: Re: Buildfarm failure from overly noisy warning message