pg.ddx.io pgsql-bugs@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Marko Tiikkaja <marko@joh.to>
Cc: Amit Kapila <amit.kapila16@gmail.com>
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: Tue, 14 Aug 2018 11:44:10 -0400
Message-ID: <390.1534261450@sss.pgh.pa.us> (raw)
In-Reply-To: <CAL9smLD+d+Bi1tvA8og5J+ZrW2E-yuyL1w4k2CdX3Fxb-vWDOQ@mail.gmail.com>
References: <153417684333.10284.11356259990921828616@wrigleys.postgresql.org>
<20180813163518.gqvu2kqwr6uj75vj@alap3.anarazel.de>
<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>
Marko Tiikkaja <marko@joh.to> writes:
> Marking the function parallel safe doesn't seem wrong to me. The
> non-parallel-safe part is that the input gets fed to it in different order
> in different workers. And I don't really think that to be the function's
> fault.
So that basically opens the question of whether *any* window function
calculation can safely be pushed down to parallel workers.
Somewhat like the LIMIT/OFFSET case, it seems to me that we could only
expect to do this safely if the row ordering induced by the WINDOW clause
can be proven to be fully deterministic. The planner has no such smarts
at the moment AFAIR. In principle you could do it if there were
partitioning/ordering by a primary key, but I'm not excited about the
prospects of that being true often enough in practice to justify making
the check.
regards, tom lane
view thread (38+ messages) latest in thread
Message-ID: <390.1534261450@sss.pgh.pa.us> Permalink: ../390.1534261450@sss.pgh.pa.us/ Also on: postgresql.org/message-id/390.1534261450@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, marko@joh.to, amit.kapila16@gmail.com, andres@anarazel.de, andy@prestigedigital.com Subject: Re: BUG #15324: Non-deterministic behaviour from parallelised sub-query In-Reply-To: <390.1534261450@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> <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> * 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