Re: WIP Patch: Precalculate stable functions, infrastructure v1

2022-05-23 Thread David Geier
Hi hackers! I would like to revive this thread. At ServiceNow we recurringly encounter queries that are much slower than they would have to be, because of frequent calls to uncached stable functions with constant arguments (mostly to_date()). We've seen e.g. queries that get more than 8x faster by

Re: WIP Patch: Precalculate stable functions, infrastructure v1

2019-01-31 Thread Andres Freund
On 2018-11-29 18:00:15 +0100, Dmitry Dolgov wrote: > > On Tue, Oct 2, 2018 at 4:22 AM Michael Paquier wrote: > > > > On Thu, May 24, 2018 at 04:00:33PM +0300, Marina Polyakova wrote: > > > Here there's a 9-th version of the patches for the precalculation of > > > stable > > > or immutable functio

Re: WIP Patch: Precalculate stable functions, infrastructure v1

2018-11-29 Thread Dmitry Dolgov
> On Tue, Oct 2, 2018 at 4:22 AM Michael Paquier wrote: > > On Thu, May 24, 2018 at 04:00:33PM +0300, Marina Polyakova wrote: > > Here there's a 9-th version of the patches for the precalculation of stable > > or immutable functions, stable or immutable operators and other nonvolatile > > expressi

Re: WIP Patch: Precalculate stable functions, infrastructure v1

2018-10-01 Thread Michael Paquier
Hi Marina, On Thu, May 24, 2018 at 04:00:33PM +0300, Marina Polyakova wrote: > Here there's a 9-th version of the patches for the precalculation of stable > or immutable functions, stable or immutable operators and other nonvolatile > expressions. This is a try to execute cached expressions as PAR

Re: Re: WIP Patch: Precalculate stable functions, infrastructure v1

2018-03-07 Thread David Steele
On 3/3/18 2:42 AM, Marina Polyakova wrote: > Ok! > > On 02-03-2018 22:56, Andres Freund wrote: >> Hi, >> >> On 2018-03-02 11:22:01 +0300, Marina Polyakova wrote: >>> I fixed the failure that Thomas pointed out to me, and I'm finishing >>> work on >>> it, but it took me a while to study this part o

Re: WIP Patch: Precalculate stable functions, infrastructure v1

2018-03-02 Thread Marina Polyakova
Ok! On 02-03-2018 22:56, Andres Freund wrote: Hi, On 2018-03-02 11:22:01 +0300, Marina Polyakova wrote: I fixed the failure that Thomas pointed out to me, and I'm finishing work on it, but it took me a while to study this part of the executor.. I unfortunately think that makes this too late

Re: WIP Patch: Precalculate stable functions, infrastructure v1

2018-03-02 Thread Andres Freund
Hi, On 2018-03-02 11:22:01 +0300, Marina Polyakova wrote: > I fixed the failure that Thomas pointed out to me, and I'm finishing work on > it, but it took me a while to study this part of the executor.. I unfortunately think that makes this too late for v11, and we should mark this as returned wi

Re: WIP Patch: Precalculate stable functions, infrastructure v1

2018-03-02 Thread Marina Polyakova
Hello! I fixed the failure that Thomas pointed out to me, and I'm finishing work on it, but it took me a while to study this part of the executor.. On 02-03-2018 0:11, Andres Freund wrote: Hi, On 2018-02-01 08:01:48 +0300, Marina Polyakova wrote: > ISTM, there might be some value to conside

Re: WIP Patch: Precalculate stable functions, infrastructure v1

2018-03-01 Thread Andres Freund
Hi, On 2018-02-01 08:01:48 +0300, Marina Polyakova wrote: > > ISTM, there might be some value to consider all of them in the design of > > the new mechanism. > > I'm sorry, the other parts have occupied all the time, and I'll work on it.. That has, as far as I can see, not happened. And the patch

Re: WIP Patch: Precalculate stable functions, infrastructure v1

2018-02-05 Thread Marina Polyakova
Hello! Thank you for reporting! I'll try to get it on our buildfarm.. On 05-02-2018 0:10, Thomas Munro wrote: On Thu, Feb 1, 2018 at 6:01 PM, Marina Polyakova wrote: This is the 8-th version of the patch for the precalculation of stable or immutable functions, stable or immutable operators an

Re: WIP Patch: Precalculate stable functions, infrastructure v1

2018-02-04 Thread Thomas Munro
On Thu, Feb 1, 2018 at 6:01 PM, Marina Polyakova wrote: > This is the 8-th version of the patch for the precalculation of stable or > immutable functions, stable or immutable operators and other nonvolatile > expressions. This is a try to fix the most problems (I'm sorry, it took some > time..) th

Re: WIP Patch: Precalculate stable functions, infrastructure v1

2018-01-25 Thread Marina Polyakova
Hello! On 24-01-2018 23:36, Andres Freund wrote: On 2018-01-24 15:10:56 -0500, Tom Lane wrote: ... Keeping the stored value of a CachedExpr in a Param slot is an interesting idea indeed. We keep coming back to this, IIRC we had a pretty similar discussion around redesigning caseValue_datum/is

Re: WIP Patch: Precalculate stable functions, infrastructure v1

2018-01-24 Thread Andres Freund
On 2018-01-24 15:10:56 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2018-01-16 17:05:01 -0500, Tom Lane wrote: > >> I'm curious to know whether Andres has some other ideas, or whether he > >> feels this is all a big wart on the compiled-expression concept. > > > I don't have too many "art

Re: WIP Patch: Precalculate stable functions, infrastructure v1

2018-01-24 Thread Tom Lane
Andres Freund writes: > On 2018-01-16 17:05:01 -0500, Tom Lane wrote: >> I'm curious to know whether Andres has some other ideas, or whether he >> feels this is all a big wart on the compiled-expression concept. > I don't have too many "artistic" concerns from the compiled expression > POV. The b

Re: WIP Patch: Precalculate stable functions, infrastructure v1

2018-01-24 Thread Andres Freund
Hi, On 2018-01-16 17:05:01 -0500, Tom Lane wrote: > [ I'm sending this comment separately because I think it's an issue > Andres might take an interest in. ] Thanks for that. I indeed am interested. Sorry for the late response, was very deep into the JIT patch. > Marina Polyakova writes: > >

Re: WIP Patch: Precalculate stable functions, infrastructure v1

2018-01-20 Thread Marina Polyakova
On 17-01-2018 1:05, Tom Lane wrote: [ I'm sending this comment separately because I think it's an issue Andres might take an interest in. ] Marina Polyakova writes: [ v7-0001-Precalculate-stable-and-immutable-functions.patch ] Another thing that's bothering me is that the execution semantics

Re: WIP Patch: Precalculate stable functions, infrastructure v1

2018-01-20 Thread Marina Polyakova
As I said, thank you so much for your comments!! On 17-01-2018 0:30, Tom Lane wrote: ... This is indeed quite a large patch, but it seems to me it could become smaller. After a bit of review: 1. I do not like what you've done with ParamListInfo. The changes around that are invasive, accountin

Re: WIP Patch: Precalculate stable functions, infrastructure v1

2018-01-17 Thread Marina Polyakova
Thank you so much for your comments!! I'll answer a bit later because now I'm trying to find a test for int128 on Solaris 10.. [1] On 17-01-2018 1:05, Tom Lane wrote: [ I'm sending this comment separately because I think it's an issue Andres might take an interest in. ] Marina Polyakova write

Re: WIP Patch: Precalculate stable functions, infrastructure v1

2018-01-16 Thread Tom Lane
[ I'm sending this comment separately because I think it's an issue Andres might take an interest in. ] Marina Polyakova writes: > [ v7-0001-Precalculate-stable-and-immutable-functions.patch ] Another thing that's bothering me is that the execution semantics you're proposing for CachedExpr seem

Re: WIP Patch: Precalculate stable functions, infrastructure v1

2018-01-16 Thread Tom Lane
Aleksander Alekseev writes: > I can confirm this code works. However, since this is quite a large patch, I > believe we better have a second reviewer or a very attentive committer. > The new status of this patch is: Ready for Committer This is indeed quite a large patch, but it seems to me it c

Re: WIP Patch: Precalculate stable functions, infrastructure v1

2018-01-15 Thread Aleksander Alekseev
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: tested, passed Documentation:tested, passed I can confirm this code works. However, since this is quite a