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 1opr4Q-0000xQ-GC for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Nov 2022 13:12:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1opr4P-00089C-6s for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Nov 2022 13:12:45 +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 1opr4O-000892-Tx for pgsql-hackers@lists.postgresql.org; Tue, 01 Nov 2022 13:12:44 +0000 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1opr4M-0006rU-H9 for pgsql-hackers@lists.postgresql.org; Tue, 01 Nov 2022 13:12:43 +0000 Received: by mail-il1-x12d.google.com with SMTP id 7so7712281ilg.11 for ; Tue, 01 Nov 2022 06:12:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=2n9i3Hd2UNjNRDEe7/RnlYN1h2aKLOrdiElneoxvN1M=; b=Aa/Yp5xt2TdUQLW2B0dBdyF2kL20A7Z4RSXmGKFcws8SKTdHmRywfJQiD1+uoDjldH wNiK4ee3FRinIPZPUd4gU4f6ygE/7m0NQ5I1/gorI1oG8mfsNARfA/cwb6mhAQcx34LG ljs2ZDAMsO2ZaR3GrkHEPuRrHbCarbxjZxDYsHFgs6Z0fA7xvw5aCyMQF6dXr+Ut4N3z nv0qqQn7H9k2YIwyX9QVEWI5F0JyOuG6KybCQGhCOU8vNLcjWuGnm+/oi/fxl/J5uPDs OyAMkni3+x1S9Fn+GeFDU5ucIG209TOdIbsPs+8HCJOmxvfXF1zUQvKvn/XdsELuTkvI vguw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2n9i3Hd2UNjNRDEe7/RnlYN1h2aKLOrdiElneoxvN1M=; b=Ni3zRgv1AbXB8wuqqEm8hqJ06Tq7Goy01Z8ew1uD4AZb+3LlIBQ1QQDSWjbaQxWdsx H8AKFcNKR9NqC40dF8peglDfTV1ikKnQc2kw+3IrNo+zRaAyRjNbG3IFefTRgIG7hP17 wVa5koPGXQpMV0LiA/bnjTmqTJ7ogskriZg+TjAHELNoYBuB15gg31vftUPMB90BOwA6 i162+Ac2TPKusff7aktANGNbKrgQn5biio1qyYTk0npuQEI1b8JCcTWIXIqHIMlCAzvL t2JoDrxDJsTsrsisb4MsdlMLf3jJnXxuvqInWUgsh6UTGdCxAABNz7T47BqDkLJ/q91v WXyw== X-Gm-Message-State: ACrzQf1a8gPYrbGdx9usTxO66F1fg+7RtBn45vtM/cEsCA27H3H6GoDv 1RZ5kOLhSBMgIhWotIpneUfQfA== X-Google-Smtp-Source: AMsMyM4WT/HtGl3WLqTuK4sq20A5gfA/8ypGwEw+IUfErnd/UOI1KTqQOftqY/eNRs3K8k6GMVO0+Q== X-Received: by 2002:a05:6e02:156f:b0:2ff:775f:1efd with SMTP id k15-20020a056e02156f00b002ff775f1efdmr11930762ilu.140.1667308361549; Tue, 01 Nov 2022 06:12:41 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id h7-20020a05660208c700b006bbddd49984sm3907651ioz.9.2022.11.01.06.12.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Nov 2022 06:12:41 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 3A3558008F8; Tue, 1 Nov 2022 08:12:40 -0500 (CDT) Date: Tue, 1 Nov 2022 08:12:40 -0500 From: Justin Pryzby To: Richard Guo Cc: Michael Paquier , Tomas Vondra , pgsql-hackers@lists.postgresql.org Subject: Re: pg15 inherited stats expressions: cache lookup failed for statistics object Message-ID: <20221101131240.GW16921@telsasoft.com> References: <20221030170520.GM16921@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Nov 01, 2022 at 05:33:24PM +0800, Richard Guo wrote: > On Mon, Oct 31, 2022 at 1:33 PM Michael Paquier wrote: > > > On Mon, Oct 31, 2022 at 01:12:09PM +0800, Richard Guo wrote: > > > BTW, I noticed a micro-optimization opportunity in examine_variable that > > > we can fetch the RangeTblEntry for 'onerel' outside the foreach loop > > > when iterating the extended stats so that we can do it only once rather > > > than for each stat. > > > > Isn't that the kind of thing where we'd better have some regression > > coverage? > > Yeah, we need to have some regression tests for that. I come up with a > case in stats_ext like below Well done > This case should be able to cover both expression stats and ndistinct > stats. Hence, attach v2 patch. Thanks for finishing it up. I added a CF entry and marked RFC. This should be included in v15.1. -- Justin