Re: Planner debug views

Поиск
Список
Период
Сортировка
От Qingqing Zhou
Тема Re: Planner debug views
Дата
Msg-id CAJjS0u0Ry7mxReG0or7qfd8HD3MmgYeQsp3mzJrbYc5YFgcWAw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Planner debug views  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Planner debug views  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Tue, Jul 28, 2015 at 2:43 PM, Tom Lane <tgl@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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: pg_basebackup and replication slots
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: [PATCH] Reload SSL certificates on SIGHUP