Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qvXen-005p2m-1D for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Oct 2023 06:46:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qvXel-00HVLm-FE for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Oct 2023 06:46:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qvXel-00HVKc-5Q for pgsql-hackers@lists.postgresql.org; Wed, 25 Oct 2023 06:46:19 +0000 Received: from mail-yb1-xb29.google.com ([2607:f8b0:4864:20::b29]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qvXee-002b6c-Ft for pgsql-hackers@postgresql.org; Wed, 25 Oct 2023 06:46:18 +0000 Received: by mail-yb1-xb29.google.com with SMTP id 3f1490d57ef6-d852b28ec3bso4915420276.2 for ; Tue, 24 Oct 2023 23:46:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698216371; x=1698821171; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=foNSqdPeq6FKld3U1TngRbiH5mk5wBf8sNZvgbqCjzU=; b=Q0qYWwVcK0l3rt+02jCIXUX2g2ItrTBfqNsDBJlhJgxs706Owwx2/WzxdZajr8NKt1 NIr7//8YClQHTDCRf/MB7AfbY/xGk0PvKiVk310Ed0cmZjB7nRWpkVmT3QPuYoC7qp0T Mg0SLuKw8bYP4a9Xn3imDbZKQKfy4avJTh8daR22ZaFYVTDXsKdJamxZCwj6NcAsg2A0 6Ad0YYwAgK2RdSuX4mF7DEONshqlqbwc+ICEfFVDE0d3ab3+jKXmNqQ6gWkqtATHeFw2 BwQtM+cAgzetIXHBuZB5CIYIB8SP5B+BHr4F3aLBy9xpf5NenEaDtgn+oSD5AXMVcTqV LmVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698216371; x=1698821171; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=foNSqdPeq6FKld3U1TngRbiH5mk5wBf8sNZvgbqCjzU=; b=qWIXm0xfPWwMdjjCw5QsynyU//0QkX/6ElfoztIRpCAdvZlvzDXeuEaeI0XkTgLuyD Owzh3IGT0RltvYp1c70sAWy+ZTYetsT+p1CCdZDInfB2is47iyIMYHWP38WtabktVYrD lFYFVLBq/wLrQMDRnNk8QqXzgy5HtDiJpIajAVnPmadalY1FkRtSMoL+BeKGBcToY5s2 si8jv7NYGIbm4fp/cqNRRrsH2SjEM5VGH2zN9baQau8r0R3uTkgS6X07+osSCh5Jemdi 9ADlCumYkwHJDkhW52tfchFwn4I0Ws0k/EzCCSyKn88FE2M1IJ4HOclsOC3liXkeBwEe A7cQ== X-Gm-Message-State: AOJu0YyzsefQDcHlBEGbJzcoYbqqZKYZw8r+3D932hT905UJvb5njJZS Q91pjHyk22y4mvfRZwOroLJrIH0JM4gOKnavmF4= X-Google-Smtp-Source: AGHT+IG1cNmKkRKidcjA2ablXgxeenfdOwa64AJKr8TOplZC2FGB6ff82IYqOSavTODVzpKpojiJfusAlyZlY0nV68U= X-Received: by 2002:a25:7743:0:b0:d9b:4bfd:b75 with SMTP id s64-20020a257743000000b00d9b4bfd0b75mr14835749ybc.18.1698216370841; Tue, 24 Oct 2023 23:46:10 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Richard Guo Date: Wed, 25 Oct 2023 14:45:59 +0800 Message-ID: Subject: Re: A performance issue with Memoize To: Pavel Stehule Cc: PostgreSQL-development , David Rowley , Tom Lane Content-Type: multipart/alternative; boundary="000000000000892d22060884cf15" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000892d22060884cf15 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Oct 20, 2023 at 7:43=E2=80=AFPM Pavel Stehule wrote: > +1 > > it would be great to fix this problem - I've seen this issue a few times. > Thanks for the input. I guess this is not rare in the real world. If the subquery contains lateral reference to a Var that also appears in the subquery's join clauses, we'd probably suffer from this issue. Thanks Richard --000000000000892d22060884cf15 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Fri, Oct 20, 2023 at 7:43=E2=80=AFPM P= avel Stehule <pavel.stehule@g= mail.com> wrote:
+1

=
it would be great to fix this problem - I've seen this issue= a few times.

Thanks for = the input.=C2=A0 I guess this is not rare in the real world.=C2=A0 If
th= e subquery contains lateral reference to a Var that also appears in
the = subquery's join clauses, we'd probably suffer from this issue.
<= br>Thanks
Richard
--000000000000892d22060884cf15--