Rafia Sabih <rafia.pghack...@gmail.com> writes:

Hi,

>
> At present, in postgres_fdw, if a query which is using a parallel plan is 
> fired from the remote end fails to use the
> parallel plan locally because of the presence of CURSORS. Consider the 
> following example,
...
>
> Now, to overcome this limitation, I have worked on this idea (suggested by my 
> colleague Bernd Helmle) of bypassing the
> cursors.

Do you know why we can't use parallel plan when cursor is used? Is It
related to this code in ExecutePlan?


        /*
         * Set up parallel mode if appropriate.
         *
         * Parallel mode only supports complete execution of a plan.  If we've
         * already partially executed it, or if the caller asks us to exit 
early,
         * we must force the plan to run without parallelism.
         */
        if (queryDesc->already_executed || numberTuples != 0)
                use_parallel_mode = false;

Actually I can't understand the comment as well and I had this
confusion for a long time.

-- 
Best Regards
Andy Fan



Reply via email to