Re: Parallel execution and prepared statements

From: Tobias Bussmann <t(dot)bussmann(at)gmx(dot)net>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Cc: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Subject: Re: Parallel execution and prepared statements
Date: 2016-11-15 20:57:09
Message-ID: 7D26B024-2E67-49DA-AD92-4CA0C18E59F7@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

As the patch in [1] targeting the execution of the plan in ExecutePlan depending on the destination was declined, I hacked around a bit to find another way to use parallel mode with SQL prepared statements while disabling the parallel execution in case of an non read-only execution. For this I used the already present test for an existing intoClause in ExecuteQuery to set the parallelModeNeeded flag of the prepared statement. This results in a non parallel execution of the parallel plan, as we see with a non-zero fetch count used with the extended query protocol. Despite this patch seem to work in my tests, I'm by no means confident this being a proper way of handling the situation in question.

Best
Tobias

[1] https://www.postgresql.org/message-id/CAA4eK1KxiYm8F9Pe9xvqzoZocK43w%3DTRPUNHZpe_iOjF%3Dr%2B_Vw%40mail.gmail.com

Attachment Content-Type Size
prepared_stmt_execute_parallel_query.patch application/octet-stream 1.7 KB
unknown_filename text/plain 3 bytes

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-11-15 20:57:39 Re: Something is broken about connection startup
Previous Message Tom Lane 2016-11-15 20:55:55 pgsql: Account for catalog snapshot in PGXACT->xmin updates.