Re: sequential explain analyze command execution

From: Marcelo Sena <marceloslacerda(at)gmail(dot)com>
To: michel wildcat <m(dot)wildcat82(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: sequential explain analyze command execution
Date: 2012-05-20 02:58:41
Message-ID: CAPmRTtPM7KJ7muW60ay-FVkTwPqj=E3iOnniGfmC07YtgAi6GA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Your first email was arrived correctly. There was no need for a second one.

As for the query you could do something like

explain analyze select *
from (query1) as q1, (query2) as q2, ... (queryN) as qN;

But that might incur in a lot of memory swapping if you select a bunch of
rows in some of these queries.

An alternative is doing something like

create function myquerytest() returning integer as $$
query1
query2
...
queryN
select 1;
$$ language sql;

explain analyze select myquerytest();

drop function myquerytest();

In either case I would put the code in a file and then "give" it to psql
using the -f option and set the -o option to the desired output file .
Since you are using pgadmin3 I have no idea.

good luck,
Marcelo Lacerda

On Sat, May 19, 2012 at 5:20 AM, michel wildcat <m(dot)wildcat82(at)gmail(dot)com>wrote:

> hello,
> I am working with PostgreSQL 9 in windows (pgAdmin3) and I'm trying to
> execute distinct EXPLAIN ANALYZE command on some queries that are
> really time consumming, and send the results to a single file.
> can anybody help me to solve this please?
> thanks
>
> --
> Sent via pgsql-novice mailing list (pgsql-novice(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice
>

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message michel wildcat 2012-05-21 19:42:08 Fwd: sequential explain analyze command execution
Previous Message michel wildcat 2012-05-19 09:02:53 EXPLAIN ANALYZE in batch file