Re: IMMUTABLE and PARALLEL SAFE function markings

From: Andres Freund <andres(at)anarazel(dot)de>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)com>, Gajus Kuizinas <gajus(at)gajus(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: IMMUTABLE and PARALLEL SAFE function markings
Date: 2018-11-27 00:17:44
Message-ID: 20181127001744.qfjbd7sgxcx55z2x@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2018-11-26 19:13:17 -0500, Stephen Frost wrote:
> Greetings,
>
> * Andres Freund (andres(at)anarazel(dot)de) wrote:
> > On 2018-11-26 19:05:02 -0500, Stephen Frost wrote:
> > > Agreed, but I could see us having a regression test which complains if
> > > it finds any which are marked as immutable but aren't parallel safe.
> >
> > That doesn't help if a user writes a query to review the not parallel
> > safe functions in their installation.
>
> I'm really not sure what you're getting at here..?

You replied to me saying it'd be a bad idea to infer parallel safety
from immutability:

> > > Surely a simple rule could be made that provolatile='i' trumps
> > > proparallel. No need to make them agree.
> > > [...]
> >
> > I think it'd be entirely unacceptable that
> > SELECT * FROM pg_proc WHERE proparallel = 's'
> > wouldn't actually return all the functions that are parallel safe.
>
> Agreed, but I could see us having a regression test which complains if
> it finds any which are marked as immutable but aren't parallel safe.

I'm saying that that doesn't address my concern.

> Parallel safe functions should be marked as such. Immutable functions
> should be marked as such. We should not assume that one implies the
> other, nor should we operate as if they do.
>
> My suggestion for a regression test was to make PG developers really
> think about if their new immutable functions should also be marked as
> parallel safe, in the event that they forget to mark it as such. If
> it's really immutable and not parallel safe, then they need to adjust
> the expected regression test output (and we can all see it...).

See http://archives.postgresql.org/message-id/20181126234521.rh3grz7aavx2ubjv%40alap3.anarazel.de

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-11-27 00:19:51 Re: pg_config wrongly marked as not parallel safe?
Previous Message Stephen Frost 2018-11-27 00:16:00 Re: pg_config wrongly marked as not parallel safe?