Running explain analyze in a transaction

Поиск
Список
Период
Сортировка
Искать

Running explain analyze in a transaction

От:
Tim Uckun <timuckun@gmail.com>
Дата:
I want to to do the following.

begin;
explain analyze blah
rollback;

If I do this I don't get the results of the analyze.

I have been resorting to commenting out the rollback and running it separately but it's a bit of a pain.

Is there an easier way to do this?

Re: Running explain analyze in a transaction

От:
Guillaume Lelarge <guillaume@lelarge.info>
Дата:
Hi,

2015-04-10 1:13 GMT+02:00 Tim Uckun <timuckun@gmail.com>:
I want to to do the following.

begin;
explain analyze blah
rollback;

If I do this I don't get the results of the analyze.

I have been resorting to commenting out the rollback and running it separately but it's a bit of a pain.

Is there an easier way to do this?


Nope. The query tool gets the result of the last query only. So you need to do it in two steps.

Re: Running explain analyze in a transaction

От:
Melvin Davidson <melvin6925@yahoo.com>
Дата:
What you need to do is leave off ROLLBACK until
you examine the output.

Or perhaps just redirect the output to capture the results.

IE:
\o some_result_file
BEGIN;
EXPLAIN ANALYZE blah;
ROLLBACK;

However, perhaps a better thing to do is just leave out the ANALYZE as that is what causes the execution and only adds timing to the results.
 
Melvin Davidson


Folk Alley - All Folk - 24 Hours a day
www.folkalley.com



From: Tim Uckun <timuckun@gmail.com>
To: "pgadmin-support@postgresql.org" <pgadmin-support@postgresql.org>
Sent: Thursday, April 9, 2015 7:13 PM
Subject: [pgadmin-support] Running explain analyze in a transaction

I want to to do the following.

begin;
explain analyze blah
rollback;

If I do this I don't get the results of the analyze.

I have been resorting to commenting out the rollback and running it separately but it's a bit of a pain.

Is there an easier way to do this?



Re: Running explain analyze in a transaction

От:
Tim Uckun <timuckun@gmail.com>
Дата:
I have been it in two steps but sometimes I jump on to another task and forget that I have an open transaction and shut down the app.

Anyway I would like to request a feature to let me see intermediate results because for me anyway it's not unusual to chain multiple statements together.

Thanks.

On Sat, Apr 11, 2015 at 2:50 AM, Guillaume Lelarge <guillaume@lelarge.info> wrote:
Hi,

2015-04-10 1:13 GMT+02:00 Tim Uckun <timuckun@gmail.com>:
I want to to do the following.

begin;
explain analyze blah
rollback;

If I do this I don't get the results of the analyze.

I have been resorting to commenting out the rollback and running it separately but it's a bit of a pain.

Is there an easier way to do this?


Nope. The query tool gets the result of the last query only. So you need to do it in two steps.

Re: Running explain analyze in a transaction

От:
Guillaume Lelarge <guillaume@lelarge.info>
Дата:

Le 11 avr. 2015 01:44, "Tim Uckun" <timuckun@gmail.com> a écrit :
>
> I have been it in two steps but sometimes I jump on to another task and forget that I have an open transaction and shut down the app.
>

This shouldn't be an issue because the rollback is automatic this way.

> Anyway I would like to request a feature to let me see intermediate results because for me anyway it's not unusual to chain multiple statements together.
>

That feature is frequently asked, quite possible, but hard to do. Mostly on the UI part. You need to find someone quite motivated and who has time on his hands.

> Thanks.
>
> On Sat, Apr 11, 2015 at 2:50 AM, Guillaume Lelarge <guillaume@lelarge.info> wrote:
>>
>> Hi,
>>
>> 2015-04-10 1:13 GMT+02:00 Tim Uckun <timuckun@gmail.com>:
>>>
>>> I want to to do the following.
>>>
>>> begin;
>>> explain analyze blah
>>> rollback;
>>>
>>> If I do this I don't get the results of the analyze.
>>>
>>> I have been resorting to commenting out the rollback and running it separately but it's a bit of a pain.
>>>
>>> Is there an easier way to do this?
>>>
>>
>> Nope. The query tool gets the result of the last query only. So you need to do it in two steps.
>>
>>
>> --
>> Guillaume.
>>   http://blog.guillaume.lelarge.info
>>   http://www.dalibo.com
>
>

FAQ