RE: Parallel INSERT (INTO ... SELECT ...) - Mailing list pgsql-hackers

From tsunakawa.takay@fujitsu.com
Subject RE: Parallel INSERT (INTO ... SELECT ...)
Date
Msg-id TYAPR01MB2990A0B5D5876F03AA2635D8FE8D9@TYAPR01MB2990.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: Parallel INSERT (INTO ... SELECT ...)  (Amit Langote <amitlangote09@gmail.com>)
Responses Re: Parallel INSERT (INTO ... SELECT ...)
List pgsql-hackers
From: Amit Langote <amitlangote09@gmail.com>
> Just to be clear, I'm not suggesting that we should put effort into
> making INSERT ... VALUES run in parallel.  I'm just raising my concern
> about embedding the assumption in max_parallel_hazard() that it will
> never make sense to do so.

I'm sorry I misunderstood your suggestion.  So, you're suggesting that it may be better to place the VALUES existence
checkoutside max_parallel_hazard().  (I may be a bit worried if I may misunderstanding in a different way.)
 

The description of max_parallel_hazard() gave me an impression that this is the right place to check VALUES, because
itsrole can be paraphrased in simpler words like "Tell you if the given Query is safe for parallel execution."  In that
regard,the standard_planner()'s if conditions that check Query->commandType and Query->hasModifyingCTE can be moved
intomax_parallel_hazard() too.
 

But looking closer to the description, it says "Returns the worst function hazard."  Function hazard?  Should this
functiononly check functions?  Or do we want to modify this description and get max_parallel_hazard() to provide more
service?


/*
 * max_parallel_hazard
 *      Find the worst parallel-hazard level in the given query
 *
 * Returns the worst function hazard property (the earliest in this list:
 * PROPARALLEL_UNSAFE, PROPARALLEL_RESTRICTED, PROPARALLEL_SAFE) that can
 * be found in the given parsetree.  We use this to find out whether the query
 * can be parallelized at all.  The caller will also save the result in
 * PlannerGlobal so as to short-circuit checks of portions of the querytree
 * later, in the common case where everything is SAFE.
 */
char
max_parallel_hazard(Query *parse)


Regards
Takayuki Tsunakawa



pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: Parallel INSERT (INTO ... SELECT ...)
Next
From: ROS Didier
Date:
Subject: PostgreSQL and Flashback Database