On Fri, Jun 8, 2018 at 5:06 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Jud Gardner <jgardner@comprehend.com> writes:
>> When submitted through psql I don't see the issue.
>> I also don't see it when submitting via jdbc (42.2.2) directly.
>
>> I'm seeing this via jdbc through dbVisualizer, haven't seen this kind of
>> behavior before.
>
> Interesting. It could be that dbVisualizer is setting some parameter
> or transaction mode that prevents parallelism. SERIALIZABLE mode
> does so, for example, because the serializable-transaction logic
> hasn't been taught about parallelism yet.
It plans a parallel query, but it's sending an Execute message with
max_rows = 1000. That causes PortalRun() to be called with run_once =
false, which causes execute_once to be false here:
/*
* If the plan might potentially be executed multiple times,
we must force
* it to run without parallelism, because we might exit early.
*/
if (!execute_once)
use_parallel_mode = false;
--
Thomas Munro
http://www.enterprisedb.com