Re: BUG #15324: Non-deterministic behaviour from parallelised sub-query - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #15324: Non-deterministic behaviour from parallelised sub-query
Date
Msg-id 390.1534261450@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #15324: Non-deterministic behaviour from parallelised sub-query  (Marko Tiikkaja <marko@joh.to>)
Responses Re: BUG #15324: Non-deterministic behaviour from parallelised sub-query  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Re: BUG #15324: Non-deterministic behaviour from parallelised sub-query  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-bugs
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


pgsql-bugs by date:

Previous
From: Christopher Browne
Date:
Subject: Re: Possible Spam(100.5):No receiving of password
Next
From: PG Bug reporting form
Date:
Subject: BUG #15325: RHEL 6.10 exists,download.postgresql.org doesn't support it