On Tue, Jul 28, 2015 at 2:43 PM, Tom Lane <t...@sss.pgh.pa.us> wrote: > > 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; >
I see - this is cool. There are still something bothering me: EXPLAIN is a mixed output with original text, rows for RelOptInfo, rows for Paths and possible others added later. So we have to use 't as text' to receive each line. To do the insertion, we have to further decompose each text line into fields, and then do the insertion - seems quite involved with plpgsql programming. So to simplify user's task, we may end up introduce some function to do this, like this: /* EXPLAIN target query and dump records to target tables */ select pg_dump_searchspace('target_table_for_rel', 'target_table_for_paths', 'select ... /* target query */'); Is this something we want? Regards, Qingqing -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers