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.96) (envelope-from ) id 1wi3Hc-000YWc-2m for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jul 2026 04:56:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wi3Hb-00FvjM-1B for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jul 2026 04:56:16 +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.96) (envelope-from ) id 1wi3Hb-00FvjE-0K for pgsql-hackers@lists.postgresql.org; Fri, 10 Jul 2026 04:56:15 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wi3HZ-00000000QHi-3fEV for pgsql-hackers@lists.postgresql.org; Fri, 10 Jul 2026 04:56:14 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-493ae59eca6so2005535e9.1 for ; Thu, 09 Jul 2026 21:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783659372; x=1784264172; darn=lists.postgresql.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=ZEqk/tv7U2FOkHIwShrfdWL8cpnOgMRiUlVB7OxmZ2I=; b=MysTws49b5w6nRsVeHpL5csWX2gb079GgIfFs4vpK84IxE0tzOpFVoagC+hAUjdEOb zQeFDNyeZwUBkvwRJMy0QYlv+JUsgwCwQCpLf6CqRJ4XlHGSjqudhlsNN6JKSvS/hzYE 8bWok+fP5x4k4CanrjJipxP9/YbtOzNXvbIHaB3kLMhlxe573o+N57BGMxqiS8Jw+rgh 1fmeJydO/nRXd3wJRQnJBS7F+r488dpsmvHipuA/tgNLF6Y0LhvslCNM7df2I0LiZaHS orOW3uqjQlvi4O3O5Rzsk8A5q376LCY8agTA79+AbUw2mfYgbvCRK3oqAOP/Hlx2Z//Q f/kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783659372; x=1784264172; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ZEqk/tv7U2FOkHIwShrfdWL8cpnOgMRiUlVB7OxmZ2I=; b=Boe1MJGP8qlGMb/DR7868tUarZtlvrTEGs0ET/5TIPYdxMIefGjIIXEBHK/sTY/0SR 7iK1RrujamXnpaV7FL5eI4KQWUGTr2LrPckPYm8yk+f2BOkeKVzkaQE85BbmKlb8JOkP +np6JyL6ogQ9pzULHMNt7ePg3y0WaOrFBRLgVqIc8cBE+u9qztiyZc78BoUXYEsAFsuJ /L0JDFjXMvUJ0VcaQDy5Y9eHaMHXW2vz85+/DW5ou8eoSpd4l8inrx1OvhCId1Pivq4t vSrFF3nfY+BVaHKR+tvu6t9ngTa+Ei7lJKuiecyON26JVr6GriimXzQRYWWSjXQS0qp0 Wzbw== X-Forwarded-Encrypted: i=1; AHgh+RqYKw22TYbwEtRK+u9pG6IA3oygXnYtloqgsauqj/syyR6SJPQWkdwJw/t4qcwbQrQ+SY9pNPte6g4PQPFl@lists.postgresql.org X-Gm-Message-State: AOJu0Yy3EkpZzBMoyD4hRNZoid+XKysnVVZBx4nGpOmo+r4wtrGyA4t5 g9hkMKxNuM9xrQbnQ2uJUN2pJb1k0UXfh4Z2hrDvyIWb7228bIbjH0kkzKWsUQ== X-Gm-Gg: AfdE7cnJVFH8EqrFqJpc5cQIoDIb+jg9yWCaWmDsRGi6Bo3ouM/hxpm/1lhHBtoBqJW byCkLFwcUuS7wnzBv0EVJ/6dO4g8UhWSGmAFnTWx6c3kfLpnFsDwepdtrHqrc/9iWllUnvuplU/ SsRzBiXOMLgzznPUAtcKtFNs6mT4duIijlfzQmqZ/rZftvxIBQ0IYMz668CZ0Nw1NveLrZ4523A A6kPj8w5pFAYF/zjboNOgUpCqIcj+glRXT71V7tc3CceKlOzE0nN1V+jW0NTL/HrfxbGIoJxqW7 obFoez4HG847LvbOhXlCAyiDrFV2//r8vP6hR8ONh3pWtF0xUIhNQHhNW/acaJcH6G2x1AeQpkx asvNLkHNRrb6Mm+3JwC6WjOscSn5SeHOK+i2ERndbwikJlIFJmx3a2CzpLq3ubphA2BqBjnEieg N1cJCc1BuryWJY8ogWDW8WtNQEFeEG72tzdHHaL4+v5J1HYvY/cl26iD6soaxglLU31u8HAV0X X-Received: by 2002:a05:600c:4691:b0:493:eec0:2b90 with SMTP id 5b1f17b1804b1-493eec02dbemr42864395e9.12.1783659371558; Thu, 09 Jul 2026 21:56:11 -0700 (PDT) Received: from bdtpg (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47a9de1e736sm60621827f8f.7.2026.07.09.21.56.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 21:56:11 -0700 (PDT) Date: Fri, 10 Jul 2026 04:56:09 +0000 From: Bertrand Drouvot To: Andres Freund Cc: Michael Paquier , pgsql-hackers@lists.postgresql.org Subject: Re: Add per-backend AIO statistics Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Thu, Jul 09, 2026 at 04:19:26AM +0000, Bertrand Drouvot wrote: > Hi, > > On Wed, Jul 08, 2026 at 02:08:00PM -0400, Andres Freund wrote: > > > Unfortunately I'm pretty doubtful that pgstat_backend.c is the right > > architectural direction. It'll just end up implementing all kinds of stats, > > since we'll incrementally want more and more per-backend stats. I think what > > we'd want is rather something where for each applicable stats kind we have a > > shared counter for all exited backends and then per-backend counters for live > > backends, with helpers to aggregate the exited + live stats to a total. > > That's a very nice proposal that would avoid the double counting. OTOH, that's > also a major re-design that would benefit all existing per-backend stats kinds. > > I can see 2 options: > > 1/ > > step 1: Implement per-backend AIO stats (like proposed taking into account your > remark about useless, derivable fields) + a global view. > step 2: work on the re-design > > 2/ > > step 1: work on the redesign > step 2: Add AIO stats based on the re-design > > The pros of 1/ is that step 1 would most probably land in 20, providing more user > visibility (+ it could be used or improved during the AIO write project). Step 2 > is a much larger project that might not land in 20. > > The cons, would be double counting (as there is no need to try to implement > something like [1] as we are going to re-design anyway). > > I'll be tempted to vote for 1/ to provide faster added value. What do you (Andres, > Michael) think? Actually, there is no rush to merge the per-backend AIO stats (we still have plenty of time for 20). So let's try option 2 and implement the new design first and see where it goes. I'll create a dedicated thread once ready. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com