Re: [BackendXidGetPid] only access allProcs when xid matches

From: Junwang Zhao <zhjwpku(at)gmail(dot)com>
To: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [BackendXidGetPid] only access allProcs when xid matches
Date: 2023-08-10 08:18:24
Message-ID: CAEG8a3JUYLmD5N-3JTtHq1EtsKGhwFVg7JZU6dgS3xwzJFOgTQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 10, 2023 at 4:11 PM Ashutosh Bapat
<ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> wrote:
>
> Please add this to commitfest so that it's not forgotten.
>

Added [1], thanks

[1]: https://commitfest.postgresql.org/44/4495/

> On Wed, Aug 9, 2023 at 8:37 PM Junwang Zhao <zhjwpku(at)gmail(dot)com> wrote:
> >
> > On Wed, Aug 9, 2023 at 10:46 PM Ashutosh Bapat
> > <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com> wrote:
> > >
> > > On Wed, Aug 9, 2023 at 9:30 AM Junwang Zhao <zhjwpku(at)gmail(dot)com> wrote:
> > > >
> > > > In function `BackendXidGetPid`, when looping every proc's
> > > > TransactionId, there is no need to access its PGPROC since there
> > > > is shared memory access: `arrayP->pgprocnos[index]`.
> > > >
> > > > Though the compiler can optimize this kind of inefficiency, I
> > > > believe we should ship with better code.
> > > >
> > >
> > > Looks good to me. However, I would just move the variable declaration
> > > with their assignments inside the if () rather than combing the
> > > expressions. It more readable that way.
> >
> > yeah, make sense, also checked elsewhere using the original style,
> > attachment file
> > keep that style, thanks ;)
> >
> > >
> > > --
> > > Best Wishes,
> > > Ashutosh Bapat
> >
> >
> >
> > --
> > Regards
> > Junwang Zhao
>
>
>
> --
> Best Wishes,
> Ashutosh Bapat

--
Regards
Junwang Zhao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2023-08-10 08:33:11 Re: Report planning memory in EXPLAIN ANALYZE
Previous Message Laetitia Avrot 2023-08-10 08:14:46 Re: Adding a pg_servername() function