Re: Unwanted expression simplification in PG12b2

2019-09-24 Thread Robert Haas
On Mon, Sep 23, 2019 at 9:20 PM Finnerty, Jim wrote: > If the function was moved to the FROM clause where it would be executed as a > lateral cross join instead of a target list expression, how would this affect > the cost-based positioning of the Gather? I think you'd end up turning what is no

Re: Unwanted expression simplification in PG12b2

2019-09-23 Thread Finnerty, Jim
If the function was moved to the FROM clause where it would be executed as a lateral cross join instead of a target list expression, how would this affect the cost-based positioning of the Gather? On 9/23/19, 8:59 AM, "Robert Haas" wrote: On Sun, Sep 22, 2019 at 7:47 AM Darafei "Komяpa" P

Re: Unwanted expression simplification in PG12b2

2019-09-23 Thread Robert Haas
On Sun, Sep 22, 2019 at 7:47 AM Darafei "Komяpa" Praliaskouski wrote: > A heuristic I believe should help my case (and I hardly imagine how it can > break others) is that in presence of Gather, all the function calls that are > parallel safe should be pushed into it. The cost of pushing data th

Re: Unwanted expression simplification in PG12b2

2019-09-22 Thread Komяpa
Hi, On Fri, Sep 20, 2019 at 11:14 PM Robert Haas wrote: > On Wed, Jul 17, 2019 at 5:20 PM Darafei "Komяpa" Praliaskouski > wrote: > > Indeed, it seems I failed to minimize my example. > > > > Here is the actual one, on 90GB table with 16M rows: > > https://gist.github.com/Komzpa/8d5b9008ad60f9c

Re: Unwanted expression simplification in PG12b2

2019-09-20 Thread Robert Haas
On Wed, Jul 17, 2019 at 5:20 PM Darafei "Komяpa" Praliaskouski wrote: > Indeed, it seems I failed to minimize my example. > > Here is the actual one, on 90GB table with 16M rows: > https://gist.github.com/Komzpa/8d5b9008ad60f9ccc62423c256e78b4c > > I can share the table on request if needed, but h

Re: Unwanted expression simplification in PG12b2

2019-07-17 Thread Komяpa
Hi, On Wed, Jul 17, 2019 at 11:58 PM Tom Lane wrote: > =?UTF-8?Q?Darafei_=22Kom=D1=8Fpa=22_Praliaskouski?= > 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 spati

Re: Unwanted expression simplification in PG12b2

2019-07-17 Thread Tom Lane
=?UTF-8?Q?Darafei_=22Kom=D1=8Fpa=22_Praliaskouski?= 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