Thread: explain inside begin; commit;

explain inside begin; commit;

From
Ivan Sergio Borgonovo
Date:
this:

begin;
explain select * from catalog_items limit 5;
commit;

return this:

-- Executing query:
begin;
explain select * from catalog_items limit 5;
commit;
Query result with 2 rows discarded.


Query returned successfully with no result in 58 ms.

I'm interested in explain inside a transaction because:
1) the query I'd like to explain depends on previous statements
2) it modify the DB and I'd like to keep a consistent state. If the
following queries fail I'd like to roll it back.

explain analyze doesn't make any difference in the output.
I didn't find anything in the log.

Any alternative approach?

--
Ivan Sergio Borgonovo
http://www.webthatworks.it


Re: explain inside begin; commit;

From
"Jaime Casanova"
Date:
On Mon, Aug 18, 2008 at 3:01 PM, Ivan Sergio Borgonovo
<mail@webthatworks.it> wrote:
> this:
>
> begin;
> explain select * from catalog_items limit 5;
> commit;
>
> return this:
>
> -- Executing query:
> begin;
> explain select * from catalog_items limit 5;
> commit;
> Query result with 2 rows discarded.
>
>
> Query returned successfully with no result in 58 ms.
>

don't do it in pgAdmin but in psql



--
regards,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. (593) 87171157