Re: function calls optimization

From: Andreas Karlsson <andreas(at)proxel(dot)se>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Andrzej Barszcz <abusinf(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: function calls optimization
Date: 2019-10-31 15:05:28
Message-ID: a2bc0407-a41e-7798-0129-d38a7bd5e359@proxel.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/31/19 3:45 PM, Tom Lane wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
>> On October 31, 2019 7:06:13 AM PDT, Andrzej Barszcz <abusinf(at)gmail(dot)com> wrote:
>>> Any pros and cons ?
>
>> Depends on the actual way of implementing this proposal. Think we need more details than what you idea here.
>
> We've typically supposed that the cost of searching for duplicate
> subexpressions would outweigh the benefits of sometimes finding them.

That is an important concern, but given how SQL does not make it
convenient to re-use partial results of calculations I think such
queries are quite common in real world workloads.

So if we can make it cheap enough I think that it is a worthwhile
optimization.

Andreas

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-10-31 15:06:50 Re: function calls optimization
Previous Message Andres Freund 2019-10-31 15:02:48 Re: function calls optimization