Re: Subplan result caching

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Subplan result caching
Date: 2018-07-18 18:27:48
Message-ID: CA+TgmoZYefMioZWaicAderT=XUqmP3B6aZE9r9PRa8axhFQaHw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jul 9, 2018 at 5:08 AM, David Rowley
<david(dot)rowley(at)2ndquadrant(dot)com> wrote:
> From looking at the code I see that the caching is being done inside
> nodeSubplan.c. I don't think this is the right approach to the
> problem. The problem exists for any parameterized path, so I think a
> more general approach would be much better.

Yeah, perhaps, though sometimes a more specific problem is easier to solve.

> "LazyMaterialize" seems like a good option for a name. It seems better
> than "LazyHash" since you may not want to restrict it to a hash table
> based cache in the future. A binary search tree may be a good option
> for types that cannot be hashed.

I think that's not too clear, actually. The difference between a
Materialize and a LazyMaterialize is not that this is lazy and that's
not. It's that this can cache multiple result sets for various
parameter values and that can only cache one result set.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-07-18 18:30:53 Re: Possible bug in logical replication.
Previous Message Tom Lane 2018-07-18 18:05:17 Re: ENOSPC FailedAssertion("!(RefCountErrors == 0)"