Re: [BackendXidGetPid] only access allProcs when xid matches

Поиск
Список
Период
Сортировка
От Ashutosh Bapat
Тема Re: [BackendXidGetPid] only access allProcs when xid matches
Дата
Msg-id CAExHW5v=aAXtKfKAaYx96t=VXFnkVuKShgCcD7n9-t7d=jT8=Q@mail.gmail.com
обсуждение исходный текст
Ответ на [BackendXidGetPid] only access allProcs when xid matches  (Junwang Zhao <zhjwpku@gmail.com>)
Ответы Re: [BackendXidGetPid] only access allProcs when xid matches  (Junwang Zhao <zhjwpku@gmail.com>)
Список pgsql-hackers
On Wed, Aug 9, 2023 at 9:30 AM Junwang Zhao <zhjwpku@gmail.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.

--
Best Wishes,
Ashutosh Bapat



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Support to define custom wait events for extensions
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Fix last unitialized memory warning