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 1rTDFz-0019Y4-Bt for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jan 2024 03:51:55 +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 1rTDFy-008Uhy-D9 for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jan 2024 03:51:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rTDFx-008Ugt-Uk for pgsql-hackers@lists.postgresql.org; Fri, 26 Jan 2024 03:51:53 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rTDFv-003PNA-Hv for pgsql-hackers@postgresql.org; Fri, 26 Jan 2024 03:51:52 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 40Q3poWg692841; Thu, 25 Jan 2024 22:51:50 -0500 From: Tom Lane To: David Rowley cc: Richard Guo , PostgreSQL-development Subject: Re: A performance issue with Memoize In-reply-to: References: <422277.1706207562@sss.pgh.pa.us> Comments: In-reply-to David Rowley message dated "Fri, 26 Jan 2024 16:23:46 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <692839.1706241109.1@sss.pgh.pa.us> Date: Thu, 25 Jan 2024 22:51:49 -0500 Message-ID: <692840.1706241109@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > I've adjusted the comments to what you mentioned and also leaned out > the pretty expensive test case to something that'll run much faster > and pushed the result. +1, I was wondering if the test could be cheaper. It wasn't horrid as Richard had it, but core regression tests add up over time. >> However ... it seems like we're not out of the woods yet. Why >> is Richard's proposed test case still showing >> + -> Memoize (actual rows=5000 loops=N) >> + Cache Key: t1.two, t1.two >> Seems like there is missing de-duplication logic, or something. > This seems separate and isn't quite causing the same problems as what > Richard wants to fix so I didn't touch this for now. Fair enough, but I think it might be worth pursuing later. regards, tom lane