Mastering PostgreSQL 9.6
上QQ阅读APP看书,第一时间看更新

Understanding Transactions and Locking

Locking is an important topic in any kind of database. It is not enough to understand just how it works to write proper or better applications; it is also essential from a performance point of view. Without properly handling locks, your applications might not only be slow, it might also be wrong and behave in an insane way. In my judgment, locking is key to performance and having a good overview will certainly help. Therefore, understanding locking and transaction is important for administrators and developers alike.

In this chapter, you will learn:

  • Basic locking
  • Transactions and transaction isolation
  • Deadlocks
  • Locking and foreign keys
  • Explicit and implicit locking
  • Advisory locks

At the end of the chapter, you will be able to understand and utilize PostgreSQL transactions in the most efficient way possible.