Re: Is it possible to store the output of EXPLAIN into a table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Souvik Bhattacherjee <kivuosb(at)gmail(dot)com>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Is it possible to store the output of EXPLAIN into a table
Date: 2019-04-22 16:02:01
Message-ID: 15374.1555948921@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Souvik Bhattacherjee <kivuosb(at)gmail(dot)com> writes:
> I was just wondering if it is possible to store the output of EXPLAIN into
> a table.

EXPLAIN won't do that directly, but you could make a plpgsql function
along the lines of

for t in execute explain ...
return next t;

(too lazy to check the exact details here, but I believe you can find
related examples in our regression tests) and then store the function's
result into a table.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2019-04-22 16:02:42 Re: Resetting identity columns
Previous Message Thomas Kellerer 2019-04-22 16:01:13 Re: Is it possible to store the output of EXPLAIN into a table