Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lv4f2-0007mS-MJ for pgsql-performance@arkaria.postgresql.org; Sun, 20 Jun 2021 21:07:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lv4eV-0005Bl-9W for pgsql-performance@arkaria.postgresql.org; Sun, 20 Jun 2021 21:06:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lv4eV-000585-1K for pgsql-performance@lists.postgresql.org; Sun, 20 Jun 2021 21:06:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lv4eS-0001ya-P4 for pgsql-performance@lists.postgresql.org; Sun, 20 Jun 2021 21:06:45 +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 15KL6Vdn1578975; Sun, 20 Jun 2021 17:06:31 -0400 From: Tom Lane To: Manuel Weitzman cc: David Rowley , Jeremy Schneider , "pgsql-performance@lists.postgresql.org" , Andres Freund Subject: Re: Planning performance problem (67626.278ms) In-reply-to: References: <6d58f68e-ed1a-c48e-1440-691554f6e1e7@9livesdata.com> <20190408144210.GG10080@telsasoft.com> <20190408232644.r6xixkeulsmomwfj@alap3.anarazel.de> <3f5e5673-06aa-bf7c-cdb7-0e053c45ba26@amazon.com> <767433.1619015825@sss.pgh.pa.us> Comments: In-reply-to Manuel Weitzman message dated "Sat, 19 Jun 2021 20:09:58 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1578973.1624223191.1@sss.pgh.pa.us> Date: Sun, 20 Jun 2021 17:06:31 -0400 Message-ID: <1578974.1624223191@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Manuel Weitzman writes: > I've written a very naive (and crappy) patch to show how adding > memorization to get_actual_variable_range() could help the planner on > scenarios with a big number of joins. So ... the reason why there's not caching of get_actual_variable_range results already is that I'd supposed it wouldn't be necessary given the caching of selectivity estimates that happens at the RestrictInfo level. I don't have any objection in principle to adding another caching layer if that one's not working well enough, but I think it'd be wise to first understand why it's needed. regards, tom lane