{"Entry":{"collection":"guc","key":"max_pred_locks_per_page","name":"max_pred_locks_per_page","aliases":[],"metadata":{"baseline":false,"boot_human":"Not specified","boot_val":null,"category":"Lock Management","category_zh":"","changed_in":[],"changes":[{"documentation_changed":false,"fields":{},"from":"9.6","status":"added","to":"10"}],"content_hash":"e0d7cff469eb73636a6e9a88de393fe1c455d9962d506bd5f36b5588c0dee29b","context":"","default_changed_in":[],"default_history":[{"from":"10","to":"19","value":"2"}],"editorial":{"advice":{"olap":"Partitioned queries, bulk DDL, and SERIALIZABLE reports may touch many objects; test the worst plan, not only an average transaction.","oltp":"Calibrate max_pred_locks_per_page from lock-wait logs, objects touched, and the concurrency bound. Fix long transactions and access ordering before adding shared memory or changing detection granularity.","small":"Defaults are usually sufficient. If raising a startup lock-table setting, account for max_connections, prepared transactions, and standby consistency together."},"mechanism":["Sets the maximum number of predicate-locked tuples per page. A configuration reload applies a new value; existing work already in flight is not retroactively changed.","Serializable Snapshot Isolation promotes tuple-level predicate locks to a page-level lock after this many tuples on one page. Promotion saves shared memory but increases the chance that unrelated writes appear to conflict and cause serialization failures.","Monitor and change max_pred_locks_per_page together with max_pred_locks_per_transaction, max_pred_locks_per_relation, default_transaction_isolation. Validate on the relevant server role and real workload, then use its sighup context to choose session change, reload, or restart; a historical boot default is not the current effective value."],"pitfalls":["Reading an average shared-memory sizing value as a hard per-transaction limit.","Raising it without the multiplier from connections and prepared transactions.","Expanding lock memory instead of fixing long transactions, access order, or partition explosion.","Ignoring compatible startup lock capacity on standbys."],"references":[{"title":"PostgreSQL 19 Beta 4: max_pred_locks_per_page","url":"https://www.postgresql.org/docs/19/runtime-config-locks.html#GUC-MAX-PRED-LOCKS-PER-PAGE"},{"title":"PostgreSQL 19 release notes","url":"https://www.postgresql.org/docs/19/release-19.html"}],"related":["max_pred_locks_per_transaction","max_pred_locks_per_relation","default_transaction_isolation","max_locks_per_transaction","deadlock_timeout"],"summary":"max_pred_locks_per_page — Sets the maximum number of predicate-locked tuples per page. Observed in PG10–19 Beta 4; its last measured boot default is 2 in PG19 Beta 4, with sighup context. This is a beta-snapshot fact and can change before PostgreSQL 19 GA."},"enumvals":[],"first_version":"10","group":"Lock Management","group_slug":"locks","imported_at":"2026-09-27T17:57:31.720647+08:00","intro_commit":{"authored_at":"2017-04-07T21:38:05-05:00","discussion":[],"hash":"c63172d60f242ad3581c83723a5b315bbe547a0e","subject":"Add GUCs for predicate lock promotion thresholds.","url":"https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=c63172d60f242ad3581c83723a5b315bbe547a0e"},"key":"max_pred_locks_per_page","last_version":"20","max_val":"","min_val":"","name":"max_pred_locks_per_page","position":277,"present_in":["10","11","12","13","14","15","16","17","18","19","20"],"short_desc":"This controls how many rows on a single page can be predicate-locked before the lock is promoted to covering the whole page.","short_desc_zh":"","source_rev":"english-manuals:33c79ae4ba10e23d4312225a799432ff8354855ce319b0884152926bd694ccba","unit":"","vartype":"integer"}},"Definition":{"Collection":"guc","Key":"max_pred_locks_per_page","SourceDatabase":"center","Version":"18","SourceTable":"guc","SourceKey":"max_pred_locks_per_page","SourceRevision":"english-manuals:33c79ae4ba10e23d4312225a799432ff8354855ce319b0884152926bd694ccba","Facts":{"boot_val":"2","category":"Lock Management","context":"sighup","description":"This controls how many rows on a single page can be predicate-locked before the lock is promoted to covering the whole page. The default is 2. This parameter can only be set in the postgresql.conf file or on the server command line.","doc":{"anchor":"GUC-MAX-PRED-LOCKS-PER-PAGE","file":"runtime-config-locks.html","lang":"en","sha256":"5faab37986a9ca9ff362569c12b8c63e8df57c76c9aea6e40d06e44e9abee87b","slug":"18"},"documented":true,"enumvals":null,"extra_desc":"If more than this number of tuples on the same page are locked by a connection, those locks are replaced by a page-level lock.","lang":"en","max_val":"2147483647","metadata_version":"18","min_val":"0","name":"max_pred_locks_per_page","short_desc":"Sets the maximum number of predicate-locked tuples per page.","source":"pg-settings-source-snapshot","unit":null,"vartype":"integer"},"ManualEvidence":{"doc":{"anchor":"GUC-MAX-PRED-LOCKS-PER-PAGE","file":"runtime-config-locks.html","lang":"en","sha256":"5faab37986a9ca9ff362569c12b8c63e8df57c76c9aea6e40d06e44e9abee87b","slug":"18"}},"MeasuredEvidence":{"metadata_version":"18"}},"Text":{"Collection":"guc","Key":"max_pred_locks_per_page","SourceDatabase":"center","Version":"18","Locale":"en","Title":"max_pred_locks_per_page","Summary":"This controls how many rows on a single page can be predicate-locked before the lock is promoted to covering the whole page. The default is 2. This parameter can only be set in the postgresql.conf file or on the server command line.","BodyHTML":"\u003cp\u003eThis controls how many rows on a single page can be predicate-locked before the lock is promoted to covering the whole page. The default is 2. This parameter can only be set in the postgresql.conf file or on the server command line.\u003c/p\u003e","SourceRevision":"english-manuals:33c79ae4ba10e23d4312225a799432ff8354855ce319b0884152926bd694ccba","ContentHash":"ffc7f5aa604023b10c90a63252653dd0413ed1a556f479d0d8dd722a5af336fe","Payload":{"description":"This controls how many rows on a single page can be predicate-locked before the lock is promoted to covering the whole page. The default is 2. This parameter can only be set in the postgresql.conf file or on the server command line."}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
