Re: Explain [Analyze] produces parallel scan for select Into table statements. - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Explain [Analyze] produces parallel scan for select Into table statements.
Date
Msg-id CAA4eK1JMgG_6vFLXVzVnmc0p1fb42NJU7mCzf6J-b-iXL0Uw7g@mail.gmail.com
Whole thread Raw
In response to Explain [Analyze] produces parallel scan for select Into table statements.  (Mithun Cy <mithun.cy@enterprisedb.com>)
Responses Re: Explain [Analyze] produces parallel scan for select Into table statements.
List pgsql-hackers
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.
>


- /* plan the query */

- plan = pg_plan_query(query, CURSOR_OPT_PARALLEL_OK, params);

+ /* 

+ * plan the query.

+ * 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.


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

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Improving replay of XLOG_BTREE_VACUUM records
Next
From: Fujii Masao
Date:
Subject: Re: Support for N synchronous standby servers - take 2