Re: assessing parallel-safety

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Noah Misch <noah(at)leadboat(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: assessing parallel-safety
Date: 2015-02-13 08:20:09
Message-ID: CAA4eK1+prkxNLwFJJGTwbS8RL5t5J1cDrGemycEkKVYmri1b4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Feb 13, 2015 at 2:40 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Thu, Feb 12, 2015 at 3:52 PM, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
wrote:
> >> Probably not, because many queries will scan multiple relations, and
> >> we want to do all of this work just once per query.
> >
> > By this, do you mean to say that if there is any parallel-unsafe
> > expression (function call) in query, then we won't parallelize any
> > part of query, if so why is that mandatory?
>
> Because of stuff like set_config() and txid_current(), which will fail
> outright in parallel mode. Also because the user may have defined a
> function that updates some other table in the database, which will
> also fail outright if called in parallel mode. Instead of failing, we
> want those kinds of things to fall back to a non-parallel plan.
>
> > Can't we parallelize scan on a particular relation if all the
expressions
> > in which that relation is involved are parallel-safe
>
> No, because the execution of that node can be interleaved in arbitrary
> fashion with all the other nodes in the plan tree. Once we've got
> parallel mode active, all the related prohibitions apply to
> *everything* we do thereafter, not just that one node.
>

Okay, got the point.

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2015-02-13 08:31:03 Re: SSL information view
Previous Message Michael Paquier 2015-02-13 08:17:17 Re: Review of GetUserId() Usage