From 2d6c229c7c7352b48dcfdc64032eb9cc5d978b35 Mon Sep 17 00:00:00 2001 From: Shinya Kato Date: Thu, 12 Feb 2026 10:37:26 +0900 Subject: [PATCH v2] Avoid recalculating pgprocno in ProcArrayAdd() ProcArrayAdd() already calculates pgprocno via GetNumberFromPGProc() at the top of the function, but the assignment to arrayP->pgprocnos[index] redundantly called GetNumberFromPGProc() again instead of reusing the local variable. This was introduced in commit 28f3915b7. Author: Shinya Kato Reviewed-by: Chao Li Discussion: https://postgr.es/m/CAOzEurTJO2aqd9ewQmo9vjCrFUAD8Lk+raujCfK5oWoLGUP_3w@mail.gmail.com --- src/backend/storage/ipc/procarray.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/storage/ipc/procarray.c b/src/backend/storage/ipc/procarray.c index 301f54fb5a8..5918b267014 100644 --- a/src/backend/storage/ipc/procarray.c +++ b/src/backend/storage/ipc/procarray.c @@ -525,7 +525,7 @@ ProcArrayAdd(PGPROC *proc) &ProcGlobal->statusFlags[index], movecount * sizeof(*ProcGlobal->statusFlags)); - arrayP->pgprocnos[index] = GetNumberFromPGProc(proc); + arrayP->pgprocnos[index] = pgprocno; proc->pgxactoff = index; ProcGlobal->xids[index] = proc->xid; ProcGlobal->subxidStates[index] = proc->subxidStatus; -- 2.47.3