Re: [COMMITTERS] pgsql: Simplify plpgsql's check for simple expressions.

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Simplify plpgsql's check for simple expressions.
Date: 2017-08-15 19:15:39
Message-ID: CA+TgmoaRuLrYSonO5y4-Dhiaw13yTukKWyJuRuCy2XHEAQ5O8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Tue, Aug 15, 2017 at 2:34 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>> Simplify plpgsql's check for simple expressions.
>> ...
>> https://git.postgresql.org/pg/commitdiff/00418c61244138bd8ac2de58076a1d0dd4f539f3
>
> The buildfarm members that are running force_parallel_mode = regress
> are not happy with this. Apparently, even a trivial SELECT <expression>
> can be turned into a Gather plan if force_parallel_mode says so.
>
> I assume (haven't looked) that I could hack the plpgsql code to prevent
> generating a parallel plan when it's decided the command is a simple
> SELECT. But I wonder whether that's the right place to fix it. Does
> it ever make sense to parallelize a plan that can't possibly benefit?
> IOW I am not sure that we should carry force_parallel_mode this far.

Well, I think the point of force_parallel_mode is to try running
things in workers when it's legal but not necessarily beneficial, so
I'd be disinclined to nerf this too much, but it might be OK to nerf
it a little bit. Off-hand, I'd say the obvious options are:

(1) teach exec_simple_check_plan() to consider everything non-simple
when force_parallel_mode is not off, or
(2) teach exec_save_simple_expr() to see through a Gather node to the
Result node underneath

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2017-08-15 19:16:40 pgsql: Simplify some code in logical replication launcher
Previous Message Peter Eisentraut 2017-08-15 18:47:20 pgsql: doc: Improve PDF bookmarks

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2017-08-15 19:17:06 Re: A little improvementof ApplyLauncherMain loop code
Previous Message Peter Geoghegan 2017-08-15 19:04:37 Re: What users can do with custom ICU collations in Postgres 10