]> begriffs open source - ai-pg/blob - full-docs/src/sgml/html/mvcc-intro.html
PG 18 docs from https://ftp.postgresql.org/pub/source/v18.0/postgresql-18.0-docs...
[ai-pg] / full-docs / src / sgml / html / mvcc-intro.html
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>13.1. Introduction</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="mvcc.html" title="Chapter 13. Concurrency Control" /><link rel="next" href="transaction-iso.html" title="13.2. Transaction Isolation" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">13.1. Introduction</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="mvcc.html" title="Chapter 13. Concurrency Control">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="mvcc.html" title="Chapter 13. Concurrency Control">Up</a></td><th width="60%" align="center">Chapter 13. Concurrency Control</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="transaction-iso.html" title="13.2. Transaction Isolation">Next</a></td></tr></table><hr /></div><div class="sect1" id="MVCC-INTRO"><div class="titlepage"><div><div><h2 class="title" style="clear: both">13.1. Introduction <a href="#MVCC-INTRO" class="id_link">#</a></h2></div></div></div><a id="id-1.5.12.4.2" class="indexterm"></a><a id="id-1.5.12.4.3" class="indexterm"></a><a id="id-1.5.12.4.4" class="indexterm"></a><a id="id-1.5.12.4.5" class="indexterm"></a><p>
3     <span class="productname">PostgreSQL</span> provides a rich set of tools
4     for developers to manage concurrent access to data.  Internally,
5     data consistency is maintained by using a multiversion
6     model (Multiversion Concurrency Control, <acronym class="acronym">MVCC</acronym>).
7     This means that each SQL statement sees
8     a snapshot of data (a <em class="firstterm">database version</em>)
9     as it was some
10     time ago, regardless of the current state of the underlying data.
11     This prevents statements from viewing inconsistent data produced
12     by concurrent transactions performing updates on the same
13     data rows, providing <em class="firstterm">transaction isolation</em>
14     for each database session.  <acronym class="acronym">MVCC</acronym>, by eschewing
15     the locking methodologies of traditional database systems,
16     minimizes lock contention in order to allow for reasonable
17     performance in multiuser environments.
18    </p><p>
19     The main advantage of using the <acronym class="acronym">MVCC</acronym> model of
20     concurrency control rather than locking is that in
21     <acronym class="acronym">MVCC</acronym> locks acquired for querying (reading) data
22     do not conflict with locks acquired for writing data, and so
23     reading never blocks writing and writing never blocks reading.
24     <span class="productname">PostgreSQL</span> maintains this guarantee
25     even when providing the strictest level of transaction
26     isolation through the use of an innovative <em class="firstterm">Serializable
27     Snapshot Isolation</em> (<acronym class="acronym">SSI</acronym>) level.
28    </p><p>
29     Table- and row-level locking facilities are also available in
30     <span class="productname">PostgreSQL</span> for applications which don't
31     generally need full transaction isolation and prefer to explicitly
32     manage particular points of conflict.  However, proper
33     use of <acronym class="acronym">MVCC</acronym> will generally provide better
34     performance than locks.  In addition, application-defined advisory
35     locks provide a mechanism for acquiring locks that are not tied
36     to a single transaction.
37    </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="mvcc.html" title="Chapter 13. Concurrency Control">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="mvcc.html" title="Chapter 13. Concurrency Control">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="transaction-iso.html" title="13.2. Transaction Isolation">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 13. Concurrency Control </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 13.2. Transaction Isolation</td></tr></table></div></body></html>