From: Justin Pryzby <pryzby@telsasoft.com>
To: Richard Guo <guofenglinux@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Tomas Vondra <tomas.vondra@enterprisedb.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: pg15 inherited stats expressions: cache lookup failed for statistics object
Date: Tue, 1 Nov 2022 08:12:40 -0500
Message-ID: <20221101131240.GW16921@telsasoft.com> (raw)
In-Reply-To: <CAMbWs48pb_-fV=kG8CRVvZEHhCgTFUi6XY6UPK9Ob32LzH+d8g@mail.gmail.com>
References: <20221030170520.GM16921@telsasoft.com>
<CAMbWs4-2Lp89W5X0XtV=XwpZgpozmabgWLun_U7UsuqdHW8g_A@mail.gmail.com>
<CAMbWs49E+fkLrz2A2f+PGhsgkuAep6egm+cLth5ULedwwiEUrA@mail.gmail.com>
<Y19ePmKU7v6F1PkN@paquier.xyz>
<CAMbWs48pb_-fV=kG8CRVvZEHhCgTFUi6XY6UPK9Ob32LzH+d8g@mail.gmail.com>
On Tue, Nov 01, 2022 at 05:33:24PM +0800, Richard Guo wrote:
> On Mon, Oct 31, 2022 at 1:33 PM Michael Paquier <michael@paquier.xyz> 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
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: pryzby@telsasoft.com, guofenglinux@gmail.com, michael@paquier.xyz, tomas.vondra@enterprisedb.com
Subject: Re: pg15 inherited stats expressions: cache lookup failed for statistics object
In-Reply-To: <20221101131240.GW16921@telsasoft.com>
References: <20221030170520.GM16921@telsasoft.com> <CAMbWs4-2Lp89W5X0XtV=XwpZgpozmabgWLun_U7UsuqdHW8g_A@mail.gmail.com> <CAMbWs49E+fkLrz2A2f+PGhsgkuAep6egm+cLth5ULedwwiEUrA@mail.gmail.com> <Y19ePmKU7v6F1PkN@paquier.xyz> <CAMbWs48pb_-fV=kG8CRVvZEHhCgTFUi6XY6UPK9Ob32LzH+d8g@mail.gmail.com> <20221101131240.GW16921@telsasoft.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox