Re: Statistics updates is delayed when using `commit and chain`

From: John Naylor <john(dot)naylor(at)enterprisedb(dot)com>
To: Japin Li <japinli(at)hotmail(dot)com>
Cc: Lætitia Avrot <laetitia(dot)avrot(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Statistics updates is delayed when using `commit and chain`
Date: 2021-07-12 14:08:42
Message-ID: CAFBsxsGbUgeGke_xEWfrnWqoL2U1LDCA2O5bMRr-0m8UxPqyxA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Jul 12, 2021 at 9:34 AM Japin Li <japinli(at)hotmail(dot)com> wrote:
>
>
> On Mon, 12 Jul 2021 at 20:56, Lætitia Avrot <laetitia(dot)avrot(at)gmail(dot)com>
wrote:
>
> > Hello Japin,
> >
> > Thank you for the patch. I read it and I find myself with one question:
why do we update statistics even though there was a rollback? I know that
that was the behaviour before, but is it still worth it?
> >
>
> I test the following case, and found it also update the statistics even
if we
> rollback. So I update the statistics here. On the other hands, the insert
tuple
> rollbacked still in data block, so IMO we should update the statistics.
I'm not
> sure it is right.

I understand this functionality to be tracking what happens at the physical
level, in which case it is correct. In any case, the bug reported is clear
and changing that behavior is the focus here. About the patch:

1. Needs regression tests. I'll work on it this week unless someone else
beats me to it.
2. The name ProcessNotifiesAndStat is self-documenting, but is also the
kind of thing that will become out of date if any new functionality is
needed here. It seems that these actions are post-transaction but not
clean-up, and have to do with relaying messages. No nice names come to mind
so suggestions are welcome.

--
John Naylor
EDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2021-07-12 14:16:04 Re: BUG #17101: Inconsistent behaviour when querying with anonymous composite types
Previous Message Japin Li 2021-07-12 13:34:18 Re: Statistics updates is delayed when using `commit and chain`