On Wed, Jul 17, 2019 at 11:58 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Darafei "Komяpa" Praliaskouski <me@komzpa.net> writes: > Many thanks for the parallel improvements in Postgres 12. Here is one of > cases where a costy function gets moved from a parallel worker into main > one, rendering spatial processing single core once again on some queries. > Perhaps an assumption "expressions should be mashed together as much as > possible" should be reviewed and something along "biggest part of > expression should be pushed down into parallel worker"?
I don't see anything in your test case that proves what you think it does. The expensive calculation *is* being done in the worker in the first example. It's not real clear to me why the first example is only choosing to use one worker rather than 3, but probably with a larger test case (ie bigger table) that decision would change.