On Wed, Mar 9, 2016 at 8:18 PM, Mithun Cy <mithun.cy@enterprisedb.com> wrote: > > Hi All, > > Explain [Analyze] Select Into table..... produces the plan which uses parallel scans. > > Possible Fix: > > I tried to make a patch to fix this. Now in ExplainOneQuery if into clause is > > defined then parallel plans are disabled as similar to their execution.
+ * Note: If Explain is for CreateTableAs / SelectInto Avoid parallel
+ * plans.
+ */
+plan = pg_plan_query(query, into ? 0:CURSOR_OPT_PARALLEL_OK, params);
There should be a white space between 0:CURSOR_OPT_PARALLEL_OK. Also I don't see this comment is required as similar other usage doesn't have any such comment. Fixed these two points in the attached patch.
In general, the patch looks good to me and solves the problem mentioned. I have ran the regression tests with force_parallel_mode and doesn't see any problem.