当前位置:网站首页>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 .
边栏推荐
- 当产业互联网时代真正发展完善之后,将会在每一个场景见证巨头的诞生
- 兩個數相互替換
- Applet live + e-commerce, if you want to be a new retail e-commerce, use it!
- Global and Chinese market of network connected IC card smart water meters 2022-2028: Research Report on technology, participants, trends, market size and share
- Database performance optimization tool
- 各大主流编程语言性能PK,结果出乎意料
- Getting started with Paxos
- There is a new Post-00 exam king in the testing department. I really can't do it in my old age. I have
- 【FPGA教程案例10】基于Verilog的复数乘法器设计与实现
- 视频网站手绘
猜你喜欢
【大型电商项目开发】性能压测-性能监控-堆内存与垃圾回收-39
1189. Maximum number of "balloons"
[development of large e-commerce projects] performance pressure test - Optimization - impact of middleware on performance -40
Relationship between classes and objects
Basic operations of database and table ----- delete index
Identifiers and keywords
Distributed base theory
[STM32] (I) overview and GPIO introduction
Grabbing and sorting out external articles -- status bar [4]
dotnet-exec 0.6.0 released
随机推荐
Basic operations of database and table ----- delete index
Paxos 入门
The most complete regular practical guide of the whole network. You're welcome to take it away
Daily practice (18): stack containing min function
Open3d uses GICP to register point clouds
Global and Chinese market of optical densitometers 2022-2028: Research Report on technology, participants, trends, market size and share
What you learned in the eleventh week
College degree, what about 33 year old Baoma? I still sell and test, and my monthly income is 13K+
Chia Tai International Futures: what is the master account and how to open it?
每日刷题记录 (十三)
What happened to those who focused on automated testing?
揭露测试外包公司,关于外包,你或许听到过这样的声音
Basic operation of database and table ----- phased test II
分布式BASE理论
pycharm专业版下载安装教程
有哪些收益稳定的理财产品,这两个都不错
[untitled]
[development of large e-commerce projects] performance pressure test - Performance Monitoring - heap memory and garbage collection -39
Compare whether two lists are equal
MongoDB系列之学习笔记教程汇总