Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1untgl-00CaUX-29 for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Aug 2025 06:49:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1untgk-00Dv3q-0l for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Aug 2025 06:49:50 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1untgj-00Dv3i-8G for pgsql-hackers@lists.postgresql.org; Mon, 18 Aug 2025 06:49:50 +0000 Received: from fout-a7-smtp.messagingengine.com ([103.168.172.150]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1untgh-000Q8N-0y for pgsql-hackers@postgresql.org; Mon, 18 Aug 2025 06:49:48 +0000 Received: from phl-compute-08.internal (phl-compute-08.internal [10.202.2.48]) by mailfout.phl.internal (Postfix) with ESMTP id 23698EC008F; Mon, 18 Aug 2025 02:49:47 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Mon, 18 Aug 2025 02:49:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1755499787; x=1755586187; bh=+Cfz31rc+U rYaEpf8Ro+Ylnx7otvQEbJiGYt46ATwAE=; b=Lg6K+xUwqvB6u5B2XfZ8bR2OgY b18faL9olR5PmVMw+mzWVJxBcPum86JY/ZFayz6SUdvTpB7XdINcRqKWrPslZM0T bO3uFsY0Rnyve1tNMsbxxpHsONCCQPZ+A4q94jLKT4Io7j3WL1hod5WeSEoh60Iy MgwOQHmcSBqsBfzrnzRd+4VB/YX64kQcRbTs8BXxV3dtNKTMWF5CaxZsEf9Xo5Qa lWQYWkABSJRNSOEFdPqbqmzLTj4QS8r5Gt6P5Rb1i1m8hIWSKr3Uo132Dfdy6BxN aMsxxhU1kuytxUoTSjrQypSqxDH55xJ0yX2uZPoTvQ1HbhIRoSrO1/iGTpWw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1755499787; x=1755586187; bh=+Cfz31rc+UrYaEpf8Ro+Ylnx7otvQEbJiGY t46ATwAE=; b=dPkeWAcWlBRFaaNYQPx/iXFGzj0Cbzj2nl20Tt0oZ1MWj8pR9/M u+/YwdyXEFUAe0ZDsOvXO6v66kMajWeyW+9myelPukwiaYz8I8eTs/ffwBuy2uLx z3Fn6BpHIVcAY4fxM1clHmH8zEqds+V9HKkzi6UMXz0f79al4zshVorkcJ1omGW4 wm5pk03P84yercJI+hHXkv8BufcI6A8iEIDI9/04bpODq8us1A9lvTIitCRwqMzb Hht1QphFm7sHQvznAsuor5t4WK1gAfFN6CoEazzjauNQv5wIp+En8YfCuSTv/Paz QVjwfHcj7e9fx2yt7CVFl3NHEU+zXVINJZg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgdduheduleefucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeeg fffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepnhgrgh hnrhhikhesghhmrghilhdrtghomhdprhgtphhtthhopegrshhhuhhtohhshhdrsggrphgr thdrohhsshesghhmrghilhdrtghomhdprhgtphhtthhopehrvghshhhkvghkihhrihhllh esghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhs thhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 18 Aug 2025 02:49:44 -0400 (EDT) Date: Mon, 18 Aug 2025 15:49:41 +0900 From: Michael Paquier To: Naga Appani Cc: Ashutosh Bapat , Kirill Reshke , pgsql-hackers@postgresql.org Subject: Re: [Proposal] Expose internal MultiXact member count function for efficient monitoring Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="XqvNaHFP1p81nPZB" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --XqvNaHFP1p81nPZB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Aug 17, 2025 at 01:27:29AM -0500, Naga Appani wrote: > On Thu, Aug 7, 2025 at 7:35 PM Michael Paquier wrot= e: >> >> I really think that we should move the SQL function parts of multixact.c >> into their own new file, exposing ReadMultiXactCounts() in multixact.h... >=20 > Done. The SQL-callable code now lives in > src/backend/utils/adt/multixactfuncs.c > and the accessor is declared in > src/include/access/multixact.h. My point was a bit different: multixactfuncs.c should be created first because we already have one SQL function in multixact.c that can be moved inside it, with the declarations it requires added to multixact.h. I've extracted what you did, moved the existing pg_get_multixact_members() inside the new file, and applied the result. >> ReadMultiXactCounts() is also incorrectly named with your proposal to >> expose oldestMultiXactId in the information returned to the caller... >> So perhaps this should be named GetMultiXactInformation() or something >> similar? >=20 > Renamed to GetMultiXactInfo(). + * Returns information about current MultiXact state in a single atomic re= ad: This comment is incorrect. This is not an atomic read, grabbing a consistent state of the data across one single lock acquisition. Except for this comment, this looks pretty much OK. Ashutosh, any comments? I have not looked at the rest. -- Michael --XqvNaHFP1p81nPZB Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmiizQUACgkQnvQgOdby QH1CTBAAhbT2puItdDQhRIwvE1MGl0BZWz/8IBGCxDNSLP+so2EnR4eZN5ojELhI ztIgvaB3sXYYaCHBYbGRCeBxtRTDjEmmRLWgqq79PF+sTm/TtrXZNR23kjY1A2SZ fbW5EcFMEFC+/Q63Lrw4K5f1OGMyLTpG61KmMNDLD5GL7jmNnCEwzetsdJTxMrxw k9tLmSPsvlHwCYg9r6YvupJGXrZpqAdtHAfD2mzJNWcbaqz+9/BXjGJIeqXL3wYx VU6KE72ghgBbftp2qd1Kid72CiQ9eXA/gvVnn44cXfb4lqeduYNI7QSiEP1N0nSV xnpHKWMcweh0yiApr3QYCr5KdsQEhFhyOZCwFIdHKpgVzr5WxJS39xwMVR7IWswB Q/xC/HXeaCJPaQxfx9sND42zE3WtIAc8XuTeIfQI5JPWqMViSQcW5Dc1ABQr7hOs GcdH95sWcSvSZvc0gOZLyX8teVnQeLBtGr1bZ4oZwLDHiLo/P52Mg/DYwUJg0StS 9xTtgk2yhYfz80wFFVaGvt2BimYU1e0tlvxFqFRlXkGcfPDhj/OZnw3uRrCzjt6C oKy6HoAa5BQKtMUinh2xZ5VvFmSWwaSYex4XXcuhatVDiha/kxR9DhyQioI4Ny8l mRQKIh0aFYPCNndHaNN4MqBZZXfoZAhY6j7Rlq3rOXkBjQ6RuAE= =v8Lc -----END PGP SIGNATURE----- --XqvNaHFP1p81nPZB--