Parallel execution and prepared statements - Mailing list pgsql-hackers

From Albe Laurenz
Subject Parallel execution and prepared statements
Date
Msg-id A737B7A37273E048B164557ADEF4A58B5397E86F@ntex2010i.host.magwien.gv.at
Whole thread Raw
Responses Re: Parallel execution and prepared statements  (Tobias Bussmann <t.bussmann@gmx.net>)
Re: Parallel execution and prepared statements  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Tobias Bussmann has discovered an oddity with prepared statements.

Parallel scan is used with prepared statements, but only if they have
been created with protocol V3 "Parse".
If a prepared statement has been prepared with the SQL statement PREPARE,
it will never use a parallel scan.

I guess that is an oversight in commit 57a6a72b, right?
PrepareQuery in commands/prepare.c should call CompleteCachedPlan
with cursor options CURSOR_OPT_PARALLEL_OK, just like
exec_prepare_message in tcop/postgres.c does.

The attached patch fixes the problem for me.

Yours,
Laurenz Albe

Attachment

pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: Danger of automatic connection reset in psql
Next
From: Corey Huinker
Date:
Subject: Re: proposal: psql \setfileref