pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Marko Tiikkaja <marko@joh.to>
Cc: Andres Freund <andres@anarazel.de>
Cc: Andrew Fletcher <andy@prestigedigital.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #15324: Non-deterministic behaviour from parallelised sub-query
Date: Mon, 03 Sep 2018 09:49:17 -0400
Message-ID: <15775.1535982557@sss.pgh.pa.us> (raw)
In-Reply-To: <CAA4eK1Li+g_egv8Q7TFCxzZHSaiKe7Vrt23Nr=m1mysZ3-e_3g@mail.gmail.com>
References: <CAL9smLBPZJOUWjHKgZOQaDO5FK+AkkX61BT06mpSfiNz4wdtgw@mail.gmail.com>
	<21038.1534181205@sss.pgh.pa.us>
	<CAA4eK1+1yszJgG3WBnMrRAEsBymH871c3O8UQtq3iif=siOc0g@mail.gmail.com>
	<CAL9smLAnfPJCDUUG4ckX2iznj53V7VSMsYefzZieN93YxTNOcw@mail.gmail.com>
	<CAA4eK1J-_LxN5hc6ikh=vZ4vr6Yt6eFM57gMHkFzBCRTo791Bg@mail.gmail.com>
	<CAL9smLDj9Nwm0yzShEGjfNfkNc+NzCHmHwNXFOkwp74Oj3r84g@mail.gmail.com>
	<CAA4eK1LUQX0HR_9TieA0DYpYcWFjGT-CPJ9E+HV4OnzusFY8VQ@mail.gmail.com>
	<CAL9smLD+d+Bi1tvA8og5J+ZrW2E-yuyL1w4k2CdX3Fxb-vWDOQ@mail.gmail.com>
	<390.1534261450@sss.pgh.pa.us>
	<CAA4eK1+6U0fOLMdMMk-iMC-6RSM+70p-9YqCVnWTEBH=V73Agg@mail.gmail.com>
	<20180815111006.GB3326@tamriel.snowman.net>
	<CAA4eK1JqimRvJt5=nuukG+hXGA0P2tD=D0ewYrO4u0ig_TTacg@mail.gmail.com>
	<CAA4eK1JyvN1dnBRJeor6LT2sjcjoyq8eb0N6pZ2fOZRrdZe3ow@mail.gmail.com>
	<CAA4eK1JBc67MjYjo2EXwNiyUuoFqwcR4zeSyGt6zS2F0MpJABA@mail.gmail.com>
	<19350.1534771766@sss.pgh.pa.us>
	<CAA4eK1K2zQqks=2sLC9MAJhbE3oQM-BK5e8KCd-v+vfxiMj-=g@mail.gmail.com>
	<CAA4eK1! +x+EzkkNjH3DqHdObJ-9+m2eAOzQj5Z6hmOR12JCA56A@mail.gmail.com>
	<15719.1535914520@sss.pgh.pa.us>
	<CAA4eK1Li+g_egv8Q7TFCxzZHSaiKe7Vrt23Nr=m1mysZ3-e_3g@mail.gmail.com>

Amit Kapila <amit.kapila16@gmail.com> writes:
> You haven't mentioned anything about backpatching, but I don't see any
> problem with backpatching this fix.

Yeah, we definitely need to back-patch, and that's another reason not
to touch the catalog contents.

> I will commit the attached patches in a day or so unless somebody sees
> any problem.

Looking more closely at the patch:

* The general design in max_parallel_hazard_walker appears to be that
after the initial check_functions_in_node test, the rest of it should be
an if ... else if ... else if ... else if ... chain of mutually-exclusive
IsA tests.  Whoever stuck in the NextValueExpr test (possibly me?) did so
with a tin ear, and you've duplicated that mistake here.  Please make it
"else if", and fix the NextValueExpr test to be "else if" while at it.
(Or else get rid of all the "else"s, but that would be a shade less
efficient unless the compiler is very very smart.)

* The plan tree for the added test case is hard to read because it's
unclear which tenk1 scan is which.  I'd suggest adding aliases to
clarify that, eg

+explain (costs off, verbose)
+  select count(*) from tenk1 a where (unique1, two) in
+    (select unique1, row_number() over() from tenk1 b);

HEAD patch is OK otherwise.  I didn't look at the back-branch patches.

			regards, tom lane




view thread (38+ messages)  latest in thread

Message-ID: <15775.1535982557@sss.pgh.pa.us>
Permalink:  ../15775.1535982557@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15775.1535982557@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, amit.kapila16@gmail.com, sfrost@snowman.net, marko@joh.to, andres@anarazel.de, andy@prestigedigital.com
  Subject: Re: BUG #15324: Non-deterministic behaviour from parallelised sub-query
  In-Reply-To: <15775.1535982557@sss.pgh.pa.us>
  References: <CAL9smLBPZJOUWjHKgZOQaDO5FK+AkkX61BT06mpSfiNz4wdtgw@mail.gmail.com> <CAA4eK1J-_LxN5hc6ikh=vZ4vr6Yt6eFM57gMHkFzBCRTo791Bg@mail.gmail.com> <CAL9smLDj9Nwm0yzShEGjfNfkNc+NzCHmHwNXFOkwp74Oj3r84g@mail.gmail.com> <CAA4eK1LUQX0HR_9TieA0DYpYcWFjGT-CPJ9E+HV4OnzusFY8VQ@mail.gmail.com> <CAL9smLD+d+Bi1tvA8og5J+ZrW2E-yuyL1w4k2CdX3Fxb-vWDOQ@mail.gmail.com> <390.1534261450@sss.pgh.pa.us> <CAA4eK1+6U0fOLMdMMk-iMC-6RSM+70p-9YqCVnWTEBH=V73Agg@mail.gmail.com> <20180815111006.GB3326@tamriel.snowman.net> <CAA4eK1JqimRvJt5=nuukG+hXGA0P2tD=D0ewYrO4u0ig_TTacg@mail.gmail.com> <CAA4eK1JyvN1dnBRJeor6LT2sjcjoyq8eb0N6pZ2fOZRrdZe3ow@mail.gmail.com> <CAA4eK1JBc67MjYjo2EXwNiyUuoFqwcR4zeSyGt6zS2F0MpJABA@mail.gmail.com> <19350.1534771766@sss.pgh.pa.us> <CAA4eK1K2zQqks=2sLC9MAJhbE3oQM-BK5e8KCd-v+vfxiMj-=g@mail.gmail.com> <15719.1535914520@sss.pgh.pa.us> <CAA4eK1Li+g_egv8Q7TFCxzZHSaiKe7Vrt23Nr=m1mysZ3-e_3g@mail.gmail.com> <15775.1535982557@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox