From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: Luis Carril <luis.carril@swarm64.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Trying to the behavior of a parallel query with with a change in the transaction isolation mode
Date: Mon, 12 Feb 2018 12:19:52 -0300
Message-ID: <20180212151952.txagreqdwugahsqi@alvherre.pgsql> (raw)
In-Reply-To: <FRXPR01MB0070DD3B7710D14389856B0BE7F70@FRXPR01MB0070.DEUPRD01.PROD.OUTLOOK.DE>
Luis Carril wrote:
> The transaction isolation level is serializable. This situation does not normally arise, because parallel query plans are not generated when the transaction isolation level is serializable. However, it can happen if the transaction isolation level is changed to serializable after the plan is generated and before it is executed.
> BEGIN;
> SET TRANSACTION ISOLATION LEVEL READ COMMITTED, READ ONLY;
> EXPLAIN (COSTS OFF) SELECT avg(a) FROM parallel_big;
> SET TRANSACTION ISOLATION LEVEL SERIALIZABLE, READ ONLY;
> EXPLAIN ANALYZE SELECT avg(a) FROM parallel_big;
> COMMIT;
>
>
> But complains that after the first SELECT (even if it is in an EXPLAIN) the isolation level cannot be changed, so the transaction is aborted and the SELECT is never executed (even sequentially).
>
>
> Is there any way to test the possible behavior described in the documentation?
I think you would do a PREPARE in a regular transaction, then open a
transaction changing the isolation level to serializable and try the
EXPLAIN EXECUTE there.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: alvherre@alvh.no-ip.org, luis.carril@swarm64.com
Subject: Re: Trying to the behavior of a parallel query with with a change in the transaction isolation mode
In-Reply-To: <20180212151952.txagreqdwugahsqi@alvherre.pgsql>
References: <FRXPR01MB0070DD3B7710D14389856B0BE7F70@FRXPR01MB0070.DEUPRD01.PROD.OUTLOOK.DE> <20180212151952.txagreqdwugahsqi@alvherre.pgsql>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox