public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andrei Lepikhov <[email protected]>
To: Richard Guo <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Cc: David Rowley <[email protected]>
Cc: Tom Lane <[email protected]>
Subject: Re: A performance issue with Memoize
Date: Tue, 31 Oct 2023 12:36:42 +0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAMbWs49qgcP2syquh=Ep4LEn4Kyu_Y+dd48pDhfFg0Cwq1y0UQ@mail.gmail.com>
References: <CAMbWs48XHJEK1Q1CzAQ7L9sTANTs9W1cepXu8=Kc0quUL+tg4Q@mail.gmail.com>
	<[email protected]>
	<CAMbWs49qgcP2syquh=Ep4LEn4Kyu_Y+dd48pDhfFg0Cwq1y0UQ@mail.gmail.com>

On 30/10/2023 14:55, Richard Guo wrote:
> 
> On Thu, Oct 26, 2023 at 12:07 PM Andrei Lepikhov 
> <[email protected] <mailto:[email protected]>> wrote:
> 
>     Do you've thought about the case, fixed with the commit 1db5667? As I
>     see, that bugfix still isn't covered by regression tests. Could your
>     approach of a PARAM_EXEC slot reusing break that case?
> 
> 
> Hm, I don't think so.  The issue fixed by commit 1db5667 was caused by
> sharing PARAM_EXEC slots between different levels of NestLoop.  AFAICS
> it's safe to share PARAM_EXEC slots within the same level of NestLoop.
> 
> The change here is about sharing PARAM_EXEC slots between subquery's
> subplan_params and outer-relation variables, which happens within the
> same level of NestLoop.
> ...
> Did you notice a case that the change here breaks?
> 
> Hi Tom, could you share your insights on this issue and the proposed
> fix?

I think your patch works correctly so far. I mentioned the commit 
1db5667 because, as I see, the origin of the problem was parallel 
workers. I have thought about pushing Memoize down to a parallel worker 
and couldn't imagine whether such a solution would be correct.
Sorry if I disturbed you in vain.

-- 
regards,
Andrei Lepikhov
Postgres Professional







view thread (6+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: A performance issue with Memoize
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox