Re: [HACKERS] COPY (query) TO ... doesn't allow parallelism

2017-06-03 Thread Amit Kapila
On Sat, Jun 3, 2017 at 9:34 PM, Andres Freund wrote: > Hi, > > On 2017-06-03 17:40:08 +0530, Amit Kapila wrote: >> The standard_planner check is sufficient to not generate parallel >> plans for such statements, but it won't prevent if such commands >> (which shouldn't be

Re: [HACKERS] COPY (query) TO ... doesn't allow parallelism

2017-06-03 Thread Andres Freund
Hi, On 2017-06-03 17:40:08 +0530, Amit Kapila wrote: > The standard_planner check is sufficient to not generate parallel > plans for such statements, but it won't prevent if such commands > (which shouldn't be executed by parallel workers) are present in > functions. Consider a hypothetical case

Re: [HACKERS] COPY (query) TO ... doesn't allow parallelism

2017-06-03 Thread Amit Kapila
On Thu, Jun 1, 2017 at 10:16 PM, Andres Freund wrote: > On 2017-06-01 21:37:56 +0530, Amit Kapila wrote: >> On Thu, Jun 1, 2017 at 9:34 PM, Andres Freund wrote: >> > On 2017-06-01 21:23:04 +0530, Amit Kapila wrote: >> >> On a related note, I think it might

Re: [HACKERS] COPY (query) TO ... doesn't allow parallelism

2017-06-01 Thread Andres Freund
On 2017-06-01 15:56:35 -0400, Robert Haas wrote: > > I personally think we should fix this in 9.6 and 10, but I've to admit > > I'm not entirely impartial, because Citus hit this... > > I guess it's a matter of judgement whether you want to call this a bug > or a missing feature. I wasn't really

Re: [HACKERS] COPY (query) TO ... doesn't allow parallelism

2017-06-01 Thread Robert Haas
On Wed, May 31, 2017 at 7:19 PM, Andres Freund wrote: > To me that appears to be an oversight rather than intentional. A > somewhat annoying one at that, because it's not uncommong to use COPY to > execute reports to a CSV file and such. > > Robert, am I missing a

Re: [HACKERS] COPY (query) TO ... doesn't allow parallelism

2017-06-01 Thread Andres Freund
On 2017-06-01 21:37:56 +0530, Amit Kapila wrote: > On Thu, Jun 1, 2017 at 9:34 PM, Andres Freund wrote: > > On 2017-06-01 21:23:04 +0530, Amit Kapila wrote: > >> On a related note, I think it might be better to have an > >> IsInParallelMode() check in this case as we have at

Re: [HACKERS] COPY (query) TO ... doesn't allow parallelism

2017-06-01 Thread Amit Kapila
On Thu, Jun 1, 2017 at 9:34 PM, Andres Freund wrote: > On 2017-06-01 21:23:04 +0530, Amit Kapila wrote: >> On a related note, I think it might be better to have an >> IsInParallelMode() check in this case as we have at other places. >> This is to ensure that if this command is

Re: [HACKERS] COPY (query) TO ... doesn't allow parallelism

2017-06-01 Thread Andres Freund
On 2017-06-01 21:23:04 +0530, Amit Kapila wrote: > On a related note, I think it might be better to have an > IsInParallelMode() check in this case as we have at other places. > This is to ensure that if this command is invoked via plpgsql function > and that function runs is the parallel mode, it

Re: [HACKERS] COPY (query) TO ... doesn't allow parallelism

2017-06-01 Thread Amit Kapila
On Thu, Jun 1, 2017 at 4:49 AM, Andres Freund wrote: > Hi, > > At the moment $subject doesn't allow parallelism, because copy.c's > pg_plan_query() invocation doesn't set the CURSOR_OPT_PARALLEL_OK > flag. > > To me that appears to be an oversight rather than intentional. > I

Re: [HACKERS] COPY (query) TO ... doesn't allow parallelism

2017-05-31 Thread Dilip Kumar
On Wed, May 31, 2017 at 7:19 PM, Andres Freund wrote: > At the moment $subject doesn't allow parallelism, because copy.c's > pg_plan_query() invocation doesn't set the CURSOR_OPT_PARALLEL_OK > flag. > > To me that appears to be an oversight rather than intentional. A >

[HACKERS] COPY (query) TO ... doesn't allow parallelism

2017-05-31 Thread Andres Freund
Hi, At the moment $subject doesn't allow parallelism, because copy.c's pg_plan_query() invocation doesn't set the CURSOR_OPT_PARALLEL_OK flag. To me that appears to be an oversight rather than intentional. A somewhat annoying one at that, because it's not uncommong to use COPY to execute