Re: BUG #15232: Query execution changes based on using 'explainanalyze' or not - Mailing list pgsql-bugs

From Thomas Munro
Subject Re: BUG #15232: Query execution changes based on using 'explainanalyze' or not
Date
Msg-id CAEepm=3rvRBxD_g8RngT6nAtUuTdGskL0xdDK3WXroebLDRwgg@mail.gmail.com
Whole thread Raw
In response to Re: BUG #15232: Query execution changes based on using 'explain analyze' or not  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #15232: Query execution changes based on using 'explainanalyze' or not  (Thomas Munro <thomas.munro@enterprisedb.com>)
List pgsql-bugs
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


pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #15233: Error in estimation leads to very bad parralel plan insimple 2 table join.
Next
From: Thomas Munro
Date:
Subject: Re: BUG #15225: [XX000] ERROR: invalid DSA memory alloc request size1073741824 / Where: parallel worker