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 1urfAA-00AHBS-Fq for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Aug 2025 16:07:48 +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 1urfA9-003gVs-SN for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Aug 2025 16:07:46 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1urfA9-003gVj-GQ for pgsql-hackers@lists.postgresql.org; Thu, 28 Aug 2025 16:07:46 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1urfA7-002LOY-26 for pgsql-hackers@lists.postgresql.org; Thu, 28 Aug 2025 16:07:45 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-45b7da4101fso1704425e9.3 for ; Thu, 28 Aug 2025 09:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1756397262; x=1757002062; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=uh5xymq8O5K4mty7vIMyQ6xabU//5M809LE1avkTPjs=; b=Upc5UKhl0mhe7Km1bcfBA97ObTM5M/+xsLmuEYCNKLCSyyQB5WJcwvVoo46j0Ozrbt HQM9PmiRHCBGkKfmkf6F5yvRrYYPguvfSwVkEexKnORuVxdtrO0wgGcJBsv2kBqOpxTU TtCWl8xcam3t+rsox0praGluc5Xsqk6vxNnl1W1M9YSpl0DoCi5O4dOaWoqNPZAJ5yGn /H6Hn/MMFOZlnISKv1EyqUVcn1z8ZrnmArG7St20rcRy+LOUoJmC5zZg7Ws9a8vN47cx +7Xh6Y7IAzaXw/vG9GuQbcFXXM1ARIXXk7FPbeCpZydNtQ3DLFYuRyBRK75Y0Nu50b8F VVPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1756397262; x=1757002062; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=uh5xymq8O5K4mty7vIMyQ6xabU//5M809LE1avkTPjs=; b=TSTlAveCPyawz0KUjan5wfT2JNw69LHE4IBQwoPqjLeffujT1VHJt1KaDCfAacnVa4 Gu2O4H6+E5fZDUGrcbwKIfdHIC4MXWWmwHedO9Szz146kOXJljchiotr14syBztoDjhC 3a0px/y25co49b3c1bgfOK60zIMVP/oTKRU19ZyynaUNNpIwSx0F6CyAOR1kqp/94DTH 0mgrnfiNGiZSmIJxNBx4KljZRnK+EzEiqpm8rISdK/15wqU6b6JjS5UpbOEJouwMmIxz yyL5mEqmtHu2TFy/JCYyWttOZUZTS39r19Z6uxhy5rN3G18B48z42LT938XV2+heI96x QJFg== X-Gm-Message-State: AOJu0Yz6EH1Kwhx9U5/BGe4mNjLWESU44msXS8CeN6Umuc/VuslW2hOk +IeFzpptNQ4uQSek9GGh1hGAJmcqLv/4t7Ot7Lm15iihu8XZoqT5FdZuuquorg== X-Gm-Gg: ASbGncuYl7keEdGAuEeJGUh+ztKo/fcIokzNJwqg6VUYw5EKjYuXlkz28fwZOWPhoKq 0QQZ0cYt80lND1ScRPXxhJ6FWFEKd6FIt30ineZVlVPILrLhljwIshxajonsiwXfYNbSmtViOr3 dWfb9s7YZwxP/8g3WI4oQ5fegxS3LK+6jqs3waFNwGYMPrUv0z7l9vfcYS0UrYZ6DtJnwVtiJVq gNsJ+jQZ1fmokhOy6N4746cDdmjtscDh5Dj8RL0yEG77wgyxqhN+Z8Vhm0s3O5COUHyacsnGuNi /QU6ka9Rg8V+fKiPRbDamz5kOd3QbgbcuNg7gTNkQoeP4P6XIGD3fjAbLwrNYNZTVeEmtHeahKh k9a25XnnLzZKZGvBMj4wRfgtmSYou+ITP8AxnV0jFNCPp0Jkz5v8T2ZHOCaRLixVAW2rjORdf20 D0PP6hNaSqoRrkJRFZma9PoHbuKOaoBeWNtkCNrh6XMYoFxFQgHNYJweBlyHaihjmR X-Google-Smtp-Source: AGHT+IG43R0LbjK8IZtCPqVtFu4MNy4fiBuwk5ThOk1fS358GmD6pQWwOSVY1sPXMN/Ptfw2FxkHLA== X-Received: by 2002:a05:600c:548d:b0:45b:6f48:9deb with SMTP id 5b1f17b1804b1-45b75858134mr40739275e9.28.1756397262362; Thu, 28 Aug 2025 09:07:42 -0700 (PDT) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-237-181-182.eu-west-3.compute.amazonaws.com. [15.237.181.182]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-45b6f306c93sm80386505e9.14.2025.08.28.09.07.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Aug 2025 09:07:41 -0700 (PDT) Date: Thu, 28 Aug 2025 16:07:40 +0000 From: Bertrand Drouvot To: PostgreSQL Hackers Subject: Re: Adding per backend commit and rollback counters Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="jg9kqX3osLGO+8A7" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --jg9kqX3osLGO+8A7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, On Sun, Aug 10, 2025 at 07:47:09AM +0000, Bertrand Drouvot wrote: > To sum up, v3 contains: > > 0001 - > Adding per backend commit and rollback counters > 0002 - > Adding XID generation count per backend > 0003 - > Adding the pg_stat_backend view Following recent conversations in [1], those changes have been made in v4 attached: - avoid tracking the commit and rollback counters twice (for databases and for backends) but increment the backend stats when the database ones are flushed. Same idea as [2]. - pg_stat_backend is too generic (see [3]), let's use pg_stat_backend_transaction instead. I deliberately did not use pg_stat_backend_xact to not confuse with the other "*xact*" functions/views where the meaning is not the same. I'm open to other naming suggestion though. [1]: https://www.postgresql.org/message-id/flat/aJrxug4LCg4Hm5Mm%40ip-10-97-1-34.eu-west-3.compute.internal [2]: https://www.postgresql.org/message-id/7fhpds4xqk6bnudzmzkqi33pinsxammpljwde5gfkjdygvejrj%40ojkzfr7dxkmm [3]: https://www.postgresql.org/message-id/aK8OuVPmmDTc9CFX%40ip-10-97-1-34.eu-west-3.compute.internal Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com --jg9kqX3osLGO+8A7 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v4-0001-Adding-per-backend-commit-and-rollback-counters.patch"