Re: Enabling parallelism for queries coming from SQL or other PL functions

Dilip Kumar <dilipbalaut@gmail.com>

From: Dilip Kumar <dilipbalaut@gmail.com>
To: Rafia Sabih <rafia.sabih@enterprisedb.com>
Cc: PostgreSQL Developers <pgsql-hackers@postgresql.org>
Date: 2017-02-23T15:28:17Z
Lists: pgsql-hackers
On Thu, Feb 23, 2017 at 12:11 PM, Rafia Sabih
<rafia.sabih@enterprisedb.com> wrote:
> Yes, it can be simplified to
> if (dest->mydest == DestIntoRel || (numberTuples && (dest->mydest !=
> DestSPI && dest->mydest ! DestSQLFunction)))
> Thanks.

Okay, this looks cleaner.

Few more comments.
1.I don't see any check in the code which will prevent the parallel
execution of the query inside a function if its called from a DML
statement.
e.g. If we use a function in the update statement's which has the
select statement.

2. How are you protecting, if the outer select is running in parallel,
then the function called from there should not run anything in
parallel? This may allow worker launching another set of workers.  Am
I missing something?

-- 
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com


Commits

  1. Improve access to parallel query from procedural languages.

  2. plpgsql: Don't generate parallel plans for RETURN QUERY.

  3. Allow for parallel execution whenever ExecutorRun() is done only once.