From: Tom Lane <tgl@sss.pgh.pa.us>
To: Marko Tiikkaja <marko@joh.to>
Cc: Andres Freund <andres@anarazel.de>
Cc: andy@prestigedigital.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15324: Non-deterministic behaviour from parallelised sub-query
Date: Mon, 13 Aug 2018 13:26:45 -0400
Message-ID: <21038.1534181205@sss.pgh.pa.us> (raw)
In-Reply-To: <CAL9smLBPZJOUWjHKgZOQaDO5FK+AkkX61BT06mpSfiNz4wdtgw@mail.gmail.com>
References: <153417684333.10284.11356259990921828616@wrigleys.postgresql.org>
<20180813163518.gqvu2kqwr6uj75vj@alap3.anarazel.de>
<CAL9smLBPZJOUWjHKgZOQaDO5FK+AkkX61BT06mpSfiNz4wdtgw@mail.gmail.com>
Marko Tiikkaja <marko@joh.to> writes:
> On Mon, Aug 13, 2018 at 7:35 PM, Andres Freund <andres@anarazel.de> wrote:
>> Well, the subselect with thelimit going to return different results from
>> run to run. Unless you add an ORDER BY there's no guaranteed order in
>> which tuples are returned. So I don't think it's surprising that you're
>> getting results that differ between runs.
> While this is true, that's missing the point.
Yeah, I agree. I think probably what's happening is that the sub-select
is getting pushed down to the parallel workers and they are not all
computing the same set of sub-select results, leading to inconsistent
answers at the top level.
Likely, we need to treat the presence of a LIMIT/OFFSET in a sub-select
as making it parallel-unsafe, for exactly the reason that that makes
its results non-deterministic.
regards, tom lane
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, marko@joh.to, andres@anarazel.de, andy@prestigedigital.com
Subject: Re: BUG #15324: Non-deterministic behaviour from parallelised sub-query
In-Reply-To: <21038.1534181205@sss.pgh.pa.us>
References: <153417684333.10284.11356259990921828616@wrigleys.postgresql.org> <20180813163518.gqvu2kqwr6uj75vj@alap3.anarazel.de> <CAL9smLBPZJOUWjHKgZOQaDO5FK+AkkX61BT06mpSfiNz4wdtgw@mail.gmail.com> <21038.1534181205@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