{"Entry":{"collection":"guc","key":"transaction_buffers","name":"transaction_buffers","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Resource Usage / Memory","category_zh":"","changed_in":["18"],"changes":[{"documentation_changed":false,"fields":{},"from":"16","status":"added","to":"17"},{"documentation_changed":true,"fields":{"extra_desc":{"from":"Specify 0 to have this value determined as a fraction of shared_buffers.","to":"0 means use a fraction of \"shared_buffers\"."}},"from":"17","status":"changed","to":"18"}],"content_hash":"bcf11858b0107ed4d0ada11a9c168b09bbb9d655ad73568e4c681a5ede54a705","context":"","default_changed_in":[],"default_history":[{"from":"17","to":"19","value":"0 B (0 × 8kB)"}],"editorial":{"advice":{"olap":"Analytical workload labels alone do not justify changing transaction_buffers; tune only when the underlying transaction-state facility, not table scans, is the measured bottleneck.","oltp":"Leave transaction_buffers at automatic or upstream sizing unless SLRU-specific I/O and contention prove this cache is undersized. A larger number consumes shared memory for the entire server lifetime.","small":"Keep transaction_buffers at its default on a small host. Moving scarce shared memory into an internal cache without direct evidence can reduce room for more valuable caches and processes."},"mechanism":["transaction_buffers allocates a dedicated shared buffer pool for pg_xact, which caches transaction commit-status pages. This is real startup shared memory, not a planner estimate.","Zero is an automatic-sizing request: PostgreSQL derives shared_buffers/512 and clamps it between 16 and 1024 blocks. The unit is BLCKSZ blocks, normally 8kB.","A larger cache can reduce SLRU read/write churn for unusually heavy use of the underlying feature, but it permanently consumes shared memory and does not increase the feature's logical capacity. Its postmaster context fixes the value at server start; changing it requires a restart."],"pitfalls":["Changing transaction_buffers without applying its documented unit and configuration context.","Optimizing an isolated benchmark while ignoring concurrent aggregate resource use.","Assuming a configured value guarantees operating-system or storage behavior.","Failing to retest startup, failover, and workload latency after the change."],"references":[{"title":"PostgreSQL 19 Beta 4: transaction_buffers","url":"https://www.postgresql.org/docs/19/runtime-config-resource.html#GUC-TRANSACTION-BUFFERS"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["subtransaction_buffers","shared_buffers","commit_timestamp_buffers"],"summary":"transaction_buffers — Sets the size of the dedicated buffer pool used for the transaction status cache. Observed in PG17–19 Beta 4; its last measured boot default is 0 B (0 × 8kB) in PG19 Beta 4, with postmaster context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"17","group":"Resource Usage","group_slug":"resource","imported_at":"2026-09-27T17:57:32.225603+08:00","intro_commit":{"authored_at":"2024-02-28T17:05:31+01:00","discussion":["https://postgr.es/m/2BEC2B3F-9B61-4C1D-9FB5-5FAB0F05EF86@yandex-team.ru","https://postgr.es/m/CAFiTN-vzDvNz=ExGXz6gdyjtzGixKSqs0mKHMmaQ8sOSEFZ33A@mail.gmail.com"],"hash":"53c2a97a92665be6bd7d70bd62ae6158fe4db96e","subject":"Improve performance of subsystems on top of SLRU","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=53c2a97a92665be6bd7d70bd62ae6158fe4db96e"},"key":"transaction_buffers","last_version":"20","max_val":"","min_val":"","name":"transaction_buffers","position":433,"present_in":["17","18","19","20"],"short_desc":"Specifies the amount of shared memory to use to cache the contents of pg_xact (see Table 66.1).","short_desc_zh":"","source_rev":"english-manuals:97a59c0c44c561b2f050eed0ed806e01f7b2e13aaf045792e099febdf506992a","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"transaction_buffers","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"transaction_buffers","SourceRevision":"english-manuals:97a59c0c44c561b2f050eed0ed806e01f7b2e13aaf045792e099febdf506992a","Facts":{"boot_val":"0","category":"Resource Usage / Memory","context":"postmaster","description":"Specifies the amount of shared memory to use to cache the contents of pg_xact (see Table 66.1). If this value is specified without units, it is taken as blocks, that is BLCKSZ bytes, typically 8kB. The default value is 0, which requests shared_buffers/512 up to 1024 blocks, but not fewer than 16 blocks. This parameter can only be set at server start.","doc":{"anchor":"GUC-TRANSACTION-BUFFERS","file":"runtime-config-resource.html","lang":"en","sha256":"2e207c599f0884dfbe594558c478a2c7c132578981071e980e2015f31dfce28c","slug":"18"},"documented":true,"enumvals":null,"extra_desc":"0 means use a fraction of \"shared_buffers\".","lang":"en","max_val":"131072","metadata_version":"18","min_val":"0","name":"transaction_buffers","short_desc":"Sets the size of the dedicated buffer pool used for the transaction status cache.","source":"pg-settings-source-snapshot","unit":"8kB","vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-TRANSACTION-BUFFERS","file":"runtime-config-resource.html","lang":"en","sha256":"2e207c599f0884dfbe594558c478a2c7c132578981071e980e2015f31dfce28c","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"transaction_buffers","SourceDatabase":"pgweb","Version":"18","Locale":"zh-Hans","Title":"transaction_buffers","Summary":"","BodyHTML":"\u003cp\u003e指定用于缓存\u003ccode\u003epg_xact\u003c/code\u003e内容的共享内存量（参见\u003ca href=\"/docs/18/storage-file-layout.html#PGDATA-CONTENTS-TABLE\" rel=\"nofollow\"\u003e表 66.1\u003c/a\u003e）。如果未指定单位，则视为块，即\u003ccode\u003eBLCKSZ\u003c/code\u003e字节，通常为 8kB。默认值为\u003ccode\u003e0\u003c/code\u003e，这会请求\u003ccode\u003eshared_buffers\u003c/code\u003e/512，最多 1024 个块、最少 16 个块。此参数只能在服务器启动时设置。\u003c/p\u003e","SourceRevision":"2026-09-11@29c86d9","ContentHash":"bacb706c85a3b45009cce638593d0e2309110e2a2a55ab87b1c86f4e41f2ef08","Payload":{"carried_from":"","carry_reason":"","doc_html":"\u003cp\u003e指定用于缓存\u003ccode class=\"literal\"\u003epg_xact\u003c/code\u003e内容的共享内存量（参见\u003ca href=\"/docs/18/storage-file-layout.html#PGDATA-CONTENTS-TABLE\" title=\"表 66.1. PGDATA 的内容\"\u003e表 66.1\u003c/a\u003e）。如果未指定单位，则视为块，即\u003ccode class=\"symbol\"\u003eBLCKSZ\u003c/code\u003e字节，通常为 8kB。默认值为\u003ccode class=\"literal\"\u003e0\u003c/code\u003e，这会请求\u003ccode class=\"varname\"\u003eshared_buffers\u003c/code\u003e/512，最多 1024 个块、最少 16 个块。此参数只能在服务器启动时设置。\u003c/p\u003e","doc_same_as":""}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
