Re: Subplan result caching - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Subplan result caching
Date
Msg-id 9165.1527094298@sss.pgh.pa.us
Whole thread Raw
In response to Re: Subplan result caching  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: Subplan result caching  (Andres Freund <andres@anarazel.de>)
Re: Subplan result caching  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Heikki Linnakangas <hlinnaka@iki.fi> writes:
> On 23/05/18 19:25, Tom Lane wrote:
>> To make this
>> patch safe, I think you'd need to grovel through the subquery and make
>> sure that the parameters are only used as inputs to operators that belong
>> to the type's default btree or hash opfamily.  (Many other cases would
>> work in practice, but we have no semantic knowledge that would let us be
>> sure of that.)

> Hmm. First thing that comes to mind is to use the raw bytes as cache 
> key, only treating Datums as equal if their binary representation is 
> identical.

Ah.  That would work, though it'd make the number of subquery executions
even less predictable (since some logically-equal values would compare
as physically unequal).

            regards, tom lane


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Subplan result caching
Next
From: Andrew Dunstan
Date:
Subject: Re: [PATCH] Clear up perlcritic 'missing return' warning