Re: Request more documentation for incompatibility of parallelism and plpgsql exec_run_select

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Mark Dilger <hornschnorter(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Request more documentation for incompatibility of parallelism and plpgsql exec_run_select
Date: 2017-07-03 15:27:55
Message-ID: CANP8+jLxBnj3FjzLun0d9Rfun_cvF9EA4wJW9j89eRdZ3oEAFg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 30 June 2017 at 05:14, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:

> This is explained in section 15.2 [1], refer below para:
> "The query might be suspended during execution. In any situation in
> which the system thinks that partial or incremental execution might
> occur, no parallel plan is generated. For example, a cursor created
> using DECLARE CURSOR will never use a parallel plan. Similarly, a
> PL/pgSQL loop of the form FOR x IN query LOOP .. END LOOP will never
> use a parallel plan, because the parallel query system is unable to
> verify that the code in the loop is safe to execute while parallel
> query is active."

Can you explain "unable to verify that the code in the loop is safe to
execute while parallel query is active". Surely we aren't pushing code
in the loop into the actual query, so the safety of command in the FOR
loop has nothing to do with the parallel safety of the query.

Please give an example of something that would be unsafe? Is that
documented anywhere, README etc?

FOR x IN query LOOP .. END LOOP
seems like a case that would be just fine, since we're going to loop
thru every row or break early.

Surely NO SCROLL and WITH HOLD cursors would work fine?

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chapman Flack 2017-07-03 15:30:35 Re: AdvanceXLInsertBuffer vs. WAL segment compressibility
Previous Message Rafael Martinez 2017-07-03 15:16:26 Re: Dumping database creation options and ACLs