"David E. Wheeler" <da...@kineticode.com> writes:
> I'm wondering if there's any reason why we couldn't have EXPLAIN do something 
> like this itself in core:
>
>     EXPLAIN (format table) SELECT * FROM bar;

+1 from me here, as it happens "parsing" a table-like resultset is
already implemented everywhere :)

I'd add another +1 if it were easily usable as a "normal" relation (or
SRF) from inside a query, e.g. in a WITH table expression.

WITH plan AS (
  EXPLAIN (format table) SELECT * FROM bar
)
SELECT some_plan_analysis_query_here;

Or even:

WITH plan AS (
  EXPLAIN (format table) SELECT * FROM bar
)
INSERT INTO plan_audit
SELECT * FROM plan
 WHERE actual_total_time > 12 * interval '100 ms';

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to