当前位置:网站首页>Database postragesql lock management
Database postragesql lock management
2022-07-05 01:04:00 【wx5d0241bb88268】
19.12. Lock management
deadlock_timeout (integer)
This is the total time spent waiting on a lock before deadlock detection ( In milliseconds ). Deadlock detection is relatively expensive , So the server doesn't run this every time it waits for a lock . We optimistically assume that deadlocks are uncommon in production applications , And only wait for a while before starting to detect deadlocks . Increasing this value reduces the time wasted on useless deadlock detection , But it slows down the reporting of real deadlock errors . The default is 1 second (1s), This may be the minimum you want in practice . On a high load server , You may need to increase it . The ideal setting for this value should be longer than your usual transaction time , This reduces the chance to start deadlock checking before the lock is released . Only super users can change this setting .
When log_lock_waits When set , This parameter can also determine the length of time to wait before issuing a log on lock wait . If you want to investigate lock delay , You may want to set a more normal deadlock_timeout Small value .
max_locks_per_transaction (integer)
Shared lock table tracking in max_locks_per_transaction * (max_connections + max_prepared_transactions) Objects ( As shown in the table ) The lock on the . therefore , At any moment , Only so many distinguishable objects can be locked . This parameter controls the average number of object locks allocated to each transaction . Individual transactions can lock more objects , The number of locks can be as many as all transactions in the lock table can hold . This is not the number of lines that can be locked , There is no limit to that value . The default value is 64 It has been proved by history that it is enough , But if
You need to use queries from many different tables in a transaction ( For example, query a parent table with many child tables ), You may need to increase this value . This parameter can only be set when the server is started .
When running a backup server , You must set this parameter to be greater than or equal to the value on the primary server . otherwise , Queries will not be allowed on the backup server .
max_pred_locks_per_transaction (integer)
Shared predicate lock table tracking in max_pred_locks_per_transaction * (max_connections +max_prepared_transactions) Objects ( As shown in the table ) The lock on the . therefore , At any moment , Only so many distinguishable objects can be locked . This parameter controls the average number of object locks allocated to each transaction . Individual transactions can lock more objects , The number of locks can be as many as all transactions in the lock table can hold . This is not the number of lines that can be locked , There is no limit to that value . The default value is 64 It has been shown in tests that it is usually sufficient , But if you need to use queries from many different tables in a serializable transaction ( For example, query a parent table with many child tables ), You may need to increase this value . This parameter can only be set when the server is started .
max_pred_locks_per_relation (integer)
This parameter controls before predicate locks are promoted to cover the entire relationship , How many pages or tuples can this predicate lock on a single relationship . A value greater than or equal to zero represents an absolute limit , Negative values indicate that max_pred_locks_per_transaction Divided by the absolute value of this setting . The default value is -2, It will keep the previous version of PostgreSQL Behavior in . This parameter can only be in postgresql.conf File or on the server command line .
max_pred_locks_per_page (integer)
This parameter controls until the predicate lock is promoted to cover the entire page , How many rows can this predicate lock lock on a single page . The default value is 2. This parameter can only be in postgresql.conf File or on the server command line .
边栏推荐
- 【FPGA教程案例10】基于Verilog的复数乘法器设计与实现
- 潘多拉 IOT 开发板学习(RT-Thread)—— 实验4 蜂鸣器+马达实验【按键外部中断】(学习笔记)
- What happened to those who focused on automated testing?
- Les phénomènes de « salaire inversé » et de « remplacement des diplômés » indiquent que l'industrie des tests a...
- 华为百万聘请数据治理专家!背后的千亿市场值得关注
- To sort out messy header files, I use include what you use
- The difference between string STR and new string
- Analysis and comparison of leetcode weekly race + acwing weekly race (t4/t3)
- Take you ten days to easily complete the go micro service series (IX. link tracking)
- Playwright之录制
猜你喜欢

Detailed explanation of multi-mode input event distribution mechanism

Senior Test / development programmers write no bugs? Qualifications (shackles) don't be afraid of mistakes

FEG founder rox:smartdefi will be the benchmark of the entire decentralized financial market

The performance of major mainstream programming languages is PK, and the results are unexpected

【海浪建模1】海浪建模的理论分析和matlab仿真

What you learned in the eleventh week

Huawei employs millions of data governance experts! The 100 billion market behind it deserves attention

资深测试/开发程序员写下无bug?资历(枷锁)不要惧怕错误......

Sorting selection sorting

Postman automatically fills headers
随机推荐
Which financial products with stable income are good
2022.07.03 (LC 6108 decryption message)
Learn C language from scratch day 024
POAP:NFT的采用入口?
[wave modeling 1] theoretical analysis and MATLAB simulation of wave modeling
Recursive execution mechanism
leetcode494,474
Arbitrum:二维费用
SAP UI5 应用开发教程之一百零七 - SAP UI5 OverflowToolbar 容器控件介绍的试读版
Basic operations of database and table ----- delete index
RB technology stack
What happened to those who focused on automated testing?
Insert sort of sort
26.2 billion! These universities in Guangdong Province have received heavy support
Chia Tai International Futures: what is the master account and how to open it?
Liangzai's first program life and annual summary in 2022
Robley's global and Chinese markets 2022-2028: technology, participants, trends, market size and share Research Report
Basic concept and usage of redis
Discrete mathematics: Main Normal Form (main disjunctive normal form, main conjunctive normal form)
抓包整理外篇——————状态栏[ 四]