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 1syODq-00GPO6-7N for pgsql-general@arkaria.postgresql.org; Wed, 09 Oct 2024 04:22:50 +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 1syODo-00Dn54-Ne for pgsql-general@arkaria.postgresql.org; Wed, 09 Oct 2024 04:22:48 +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 1syODo-00Dn4w-88 for pgsql-general@lists.postgresql.org; Wed, 09 Oct 2024 04:22:48 +0000 Received: from mail-dm3nam02olkn2063.outbound.protection.outlook.com ([40.92.43.63] helo=NAM02-DM3-obe.outbound.protection.outlook.com) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1syODk-00064r-T9 for pgsql-general@lists.postgresql.org; Wed, 09 Oct 2024 04:22:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bbr7cCQLn4Wg+RTeKYXlZk5eEK3m6YjFZ1DjgEf3JngT229X83XdccWcP6MM4aU9fepC5FnGZwAoSseMHPoAXY5togifamyJBp8zpihxODH3IA1Hp4Ps4h+bv/cha6aPH72OP7/PHZUe5kDazFsV8KtniLSsGBZ8CmBL7faZJ96gEqNiiVNLTS3eTSqfGjZTvR4j57eOCyzJJ2EG0brW8TK29+eWF4jCKmJGIXEB9VibjP8ZkR6T01k3iufMm1odbfWOHkDq9Z0H7gYs4ITilASXEjh56UlzXmYreMnVp5f0fnzh98tAEpqLaNsleVmvqssS86Oi7jPp4vGcLLkWmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BVSXVNHA/gI/yMY0W0v/eE61sL0qWbznVpHFwhdTsEs=; b=MGeubH4Ix4GI8wt8DDpVZ7n0RCeH7c2MlM8F/ibx4hQfANSgCgGKDSq0JN7CUFk+oKhkenuOeZWvMXIv3xyeynl5/y0eIRMHUmvixIJACiH8a11H/F9FgjkFMC2YEGGbeWs9PJ2UKxL/WsRWvOJwlx5uMPsznIKRN88r78dx7NGY/zyZse8hw4/KJ6susMuO75/hQOlYQLPKqffz2Bqetmr6JZIZaUz1vl3pCImaI5VEP7yMKq/PsoPS1oReCwMmrBPCxjZVpaxJpgpHlGVripV1EURZfywXD4rwkGWXRPuoCLWDR2AG3UR/3PP2hUlgomqf1223xNzcNupU6Sb6gw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BVSXVNHA/gI/yMY0W0v/eE61sL0qWbznVpHFwhdTsEs=; b=iEwmlpJF90AYItzMhF/OXw+xK/zAQppn+9HPXr7R52nAJt0rZ5c2bWV+9doPZfRZ6tfzHl0CFAFslRt/0lGLU9enasJTri8I+KC/cyyI/a9CVXAg3J5R/Avn6bNP0fMDXSMkIHWzq/1ehapOBngEwWYBisJNwPw3NuN1WOffjLQUCNakKb4Gkgx4NPVgrPmBf9xvspxE1kM7M4aqkGlJM0b9XBOXMsw+DgpBxqxjCg48wCq1Y9QpbZUxa5SiOyweZOMya1UTD3cEPa5g3EHVWqMMQB11hntdblcRsmfVfFCf49PIxt4wji2Z94LPidw1JGTv9yWoDdydMpJrqYYrcQ== Received: from SJ0P221MB0689.NAMP221.PROD.OUTLOOK.COM (2603:10b6:a03:3d1::21) by CO6P221MB0712.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:143::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Wed, 9 Oct 2024 04:22:41 +0000 Received: from SJ0P221MB0689.NAMP221.PROD.OUTLOOK.COM ([fe80::971b:74b9:2b88:7b08]) by SJ0P221MB0689.NAMP221.PROD.OUTLOOK.COM ([fe80::971b:74b9:2b88:7b08%5]) with mapi id 15.20.8026.020; Wed, 9 Oct 2024 04:22:41 +0000 From: senor To: "pgsql-general@lists.postgresql.org" Subject: txid_current vs xact_commit stats Thread-Topic: txid_current vs xact_commit stats Thread-Index: AQHbGfd5n9TFXded/E6foDj9BgTKdQ== Date: Wed, 9 Oct 2024 04:22:41 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0P221MB0689:EE_|CO6P221MB0712:EE_ x-ms-office365-filtering-correlation-id: a96504d5-a898-441a-6a9a-08dce81a03f4 x-microsoft-antispam: BCL:0;ARA:14566002|8060799006|19110799003|8062599003|15030799003|461199028|15080799006|7092599003|3412199025|440099028|102099032|3430499032; x-microsoft-antispam-message-info: 2tjNtJH+laVEU9HHpN7UO/PIiN+lp1zPlWRggx17kJ7UEEmdgiaoYg7v1gInUVnk4oe+lZ3ZAt+lVWarj4uPhnMDo3Ov+LUL4VhEhKuv/gbfq5cOtTMw3r+r9806PSQYEp3aEGML8/GD7wDbmF69UCClpQoYEaOMEqS/75ZMxusNTzp/qqaDEVboCVIsyMAsX5kp9AhPw0wUzm09XdktjgKhsw6K74zKldjiFy6PlkO6g4gofTJ0PXhJ/UdPG2Bv9/ZaAMfIAlUptL6SBSXbwELtx1yJDzyGGxE/NttjKiD5RbGYtcePlt0YDIpX/iLGv8GZO6kI2X1YRnxOHjOxCyCBRR8EPeyGTkBVXEB5Ua3MYiM6G6+4SvVA+3JPqbRUPavabvPp7KZPG/+ho0ax5rLjxPN7epoe8In+yrLkigimXvM5uQQP0c3YHGKlZZWUnf7wY8nsnVu/x5lA76p3BNG4m+/YpxzXDfD+Nr7T1UvOIEB6sqO46/C1V+8OQQMsPwcQAtW8+w++uJggVBwTGOJJxNEk31YG7nFE1pZ1QdxXK9/kz9nCVzynMeX6A9jbdSRcCchCT0liFdIYA1GIIqQZUE+R9ch/fzUEFYttwBWRwCSE+4S6UsVy0ZxNoVucn56YsgVkiTwFJ+s++65mmJnxDuxOqQ+i6eF8I63cwzEm70VaPIo4MGnJ6A/EQh6B0fKAKgMjQW9dGRd3v2lWQRP5U2By2L0onTXmpwxRf3JhkPU/JsIfxWCuTInzkOMr+OwWoSSF8MyHL7ugcExyIQ== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?ZXr+hP5LjJu1CfYIc1aln+YJnLnZVpIgEqqvhhE4ljX9jgSjIwSK/eVJv+?= =?iso-8859-1?Q?r7bxQZIg7ulT/z2YV8PemWLKMcac0V4PXRULu1iPquGcUxWGl45xYSz01T?= =?iso-8859-1?Q?i0ONcr6wUq33I4IgWv3EUZl5Mi+X4p4of4vImsGGboIMMdMOdSB2Gcmv5f?= =?iso-8859-1?Q?+GPrS3w4cdE4b3Dh0QAH8g5JkNJ10IHZRsnuV89r/S53NuR7kUUhayYrjy?= =?iso-8859-1?Q?W/Uxigo2rwz0Wn5T4F4AH4x54E2fMqJq9Gr+pyx/YbXGgE0fp3OhyQ+qWe?= =?iso-8859-1?Q?wA2ff6vr9gQ8bht0cV1brKERWG24jl40ArD253IZ6nj23oWaa6Eug8f4in?= =?iso-8859-1?Q?f7wvcP5J4370Try6smAEArkYtgBYgxo8CwwGWtaUdc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OIF5sLCWNKFgD67CwnuNkxIKi99qQ=3D?= Content-Type: multipart/alternative; boundary="_000_SJ0P221MB06894F3D6D38DE5C61E82B30F77F2SJ0P221MB0689NAMP_" MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-f5d03.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0P221MB0689.NAMP221.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: a96504d5-a898-441a-6a9a-08dce81a03f4 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Oct 2024 04:22:41.2369 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO6P221MB0712 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_SJ0P221MB06894F3D6D38DE5C61E82B30F77F2SJ0P221MB0689NAMP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable HI All; I was under the impression that all transactions must end with a commit or = a rollback but watching stats doesn't support this. Web searches tend to re= turn info on what a transaction is or the ratio of commits to rollbacks. I = found nothing contradicting what I think I know. I've sampled pg_stat_database.xact_commit, pg_stat_database.xact_rollback a= nd txid_current() at intervals on a few independent clusters and see that c= ommits increase anywhere from 50% to 300% of the rate of transaction increa= se. Rollback remains very near zero for all clusters. Each cluster tends to= stay consistently within a range (i.e. 120-130% or 50-70%). I've seen strange issues with the stats collector missing updates and causi= ng problems with autovacuum but that wouldn't explain more commits than tra= nsactions. All clusters receive many inserts (~10-100) in single transactio= ns but AFAIK this still counts as a single commit. Many other tables are cr= eated while processing the inserted data and much of that is done within tr= ansaction blocks. I'm not aware of anything very sophisticated in the appli= cation handling this but I could be wrong. I'm probably missing something fundamental. I know what I know but I'm not = a DBA. PG version 11 & 12 on Linux Any hints and references appreciated. Thanks, Senor --_000_SJ0P221MB06894F3D6D38DE5C61E82B30F77F2SJ0P221MB0689NAMP_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
HI All;

I was under the impression that all transactions must end with a commit or = a rollback but watching stats doesn't support this. Web searches tend to re= turn info on what a transaction is or the ratio of commits to rollbacks. I = found nothing contradicting what I think I know.

I've sampled pg_stat_database.xact_commit, pg_stat_database.xact_rollback a= nd txid_current() at intervals on a few independent clusters and see that c= ommits increase anywhere from 50% to 300% of the rate of transaction increa= se. Rollback remains very near zero for all clusters. Each cluster tends to stay consistently within a range (= i.e. 120-130% or 50-70%). 

I've seen strange issues with the stats collector missing updates and causi= ng problems with autovacuum but that wouldn't explain more commits than tra= nsactions. All clusters receive many inserts (~10-100) in single transactio= ns but AFAIK this still counts as a single commit. Many other tables are created while processing the insert= ed data and much of that is done within transaction blocks. I'm not aware o= f anything very sophisticated in the application handling this but I could = be wrong.

I'm probably missing something fundamental. I know what I know but I'm not = a DBA.
PG version 11 & 12 on Linux

Any hints and references appreciated.
Thanks,
Senor

--_000_SJ0P221MB06894F3D6D38DE5C61E82B30F77F2SJ0P221MB0689NAMP_--