transaction priority feature request - Mailing list pgsql-hackers

From Vladimír Houba jr.
Subject transaction priority feature request
Date
Msg-id HE1PR07MB3482D236F02904A775EC5D5CC73A2@HE1PR07MB3482.eurprd07.prod.outlook.com
Whole thread Raw
List pgsql-hackers
Title: Transaction Priority Management
Description:
I would like to propose a feature that allows assigning priority levels to transactions in PostgreSQL. This feature would help manage locks and prevent deadlocks by ensuring that higher-priority transactions are given precedence over lower-priority ones. When a transaction requests a lock, it should only wait if the lock is held by a transaction of the same or higher priority. If a deadlock situation is about to occur, the system would automatically roll back the lower-priority transaction, allowing the higher-priority transaction to proceed, thereby preventing deadlocks.
Use Case:
In high-concurrency environments, managing locks and preventing deadlocks can significantly impact performance and user experience. By assigning priorities to transactions, critical operations can be ensured to complete without unnecessary delays caused by locks or potential deadlocks. This is particularly useful in applications where certain transactions are time-sensitive or have higher business importance.
Benefits:
  • Improved performance and reliability in high-concurrency environments.
  • Enhanced control over transaction and lock management.
  • Prevention of deadlocks, reducing their impact on critical operations.
Conclusion:
Implementing transaction priority management in PostgreSQL would provide a valuable tool for developers and database administrators to optimize performance and manage locks more effectively, while also preventing deadlocks. I believe this feature would be a significant enhancement to PostgreSQL's robust transaction management capabilities.

--
S pozdravom / Best regards
Vladimír Houba jr.
PROSOFT, spol. s r. o., Kuzmányho 8, 010 01 Žilina, Slovakia, www.prosoft.sk
tel: +421 41 5625491
mob: +421 915 708171

pgsql-hackers by date:

Previous
From: Alexander Lakhin
Date:
Subject: Parallel tests publication and subscription might fail due to concurrent tuple update
Next
From: Thomas Munro
Date:
Subject: Re: Reject Windows command lines not convertible to system locale