Re: Is it possible to store the output of EXPLAIN into a table - Mailing list pgsql-general

From Bruce Momjian
Subject Re: Is it possible to store the output of EXPLAIN into a table
Date
Msg-id 20190422155908.tnlrajxuwmu6cg2s@momjian.us
Whole thread Raw
In response to Is it possible to store the output of EXPLAIN into a table  (Souvik Bhattacherjee <kivuosb@gmail.com>)
List pgsql-general
On Mon, Apr 22, 2019 at 11:27:18AM -0400, Souvik Bhattacherjee wrote:
> Hi,
> 
> I was just wondering if it is possible to store the output of EXPLAIN into a
> table.
> 
> 
> create temp table mytab as (select * from (explain select * from table1 where
> attr = 5) t);
> 
> 
> Unfortunately, the query above does not work.

I had to do this one and put the EXPLAIN in a function and then called
the function and captured the output, see this and following slides:

    http://momjian.us/main/writings/pgsql/optimizer.pdf#page=11

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I.  As I am, so you will be. +
+                      Ancient Roman grave inscription +



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Resetting identity columns
Next
From: Thomas Kellerer
Date:
Subject: Re: Is it possible to store the output of EXPLAIN into a table