~ubuntu-branches/ubuntu/oneiric/postgresql-9.1/oneiric-security

« back to all changes in this revision

Viewing changes to doc/src/sgml/html/mvcc-intro.html

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2011-05-11 10:41:53 UTC
  • Revision ID: james.westby@ubuntu.com-20110511104153-psbh2o58553fv1m0
Tags: upstream-9.1~beta1
ImportĀ upstreamĀ versionĀ 9.1~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 
2
<HTML
 
3
><HEAD
 
4
><TITLE
 
5
>Introduction</TITLE
 
6
><META
 
7
NAME="GENERATOR"
 
8
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
 
9
REV="MADE"
 
10
HREF="mailto:pgsql-docs@postgresql.org"><LINK
 
11
REL="HOME"
 
12
TITLE="PostgreSQL 9.1beta1 Documentation"
 
13
HREF="index.html"><LINK
 
14
REL="UP"
 
15
TITLE="Concurrency Control"
 
16
HREF="mvcc.html"><LINK
 
17
REL="PREVIOUS"
 
18
TITLE="Concurrency Control"
 
19
HREF="mvcc.html"><LINK
 
20
REL="NEXT"
 
21
TITLE="Transaction Isolation"
 
22
HREF="transaction-iso.html"><LINK
 
23
REL="STYLESHEET"
 
24
TYPE="text/css"
 
25
HREF="stylesheet.css"><META
 
26
HTTP-EQUIV="Content-Type"
 
27
CONTENT="text/html; charset=ISO-8859-1"><META
 
28
NAME="creation"
 
29
CONTENT="2011-04-27T21:20:33"></HEAD
 
30
><BODY
 
31
CLASS="SECT1"
 
32
><DIV
 
33
CLASS="NAVHEADER"
 
34
><TABLE
 
35
SUMMARY="Header navigation table"
 
36
WIDTH="100%"
 
37
BORDER="0"
 
38
CELLPADDING="0"
 
39
CELLSPACING="0"
 
40
><TR
 
41
><TH
 
42
COLSPAN="5"
 
43
ALIGN="center"
 
44
VALIGN="bottom"
 
45
><A
 
46
HREF="index.html"
 
47
>PostgreSQL 9.1beta1 Documentation</A
 
48
></TH
 
49
></TR
 
50
><TR
 
51
><TD
 
52
WIDTH="10%"
 
53
ALIGN="left"
 
54
VALIGN="top"
 
55
><A
 
56
TITLE="Concurrency Control"
 
57
HREF="mvcc.html"
 
58
ACCESSKEY="P"
 
59
>Prev</A
 
60
></TD
 
61
><TD
 
62
WIDTH="10%"
 
63
ALIGN="left"
 
64
VALIGN="top"
 
65
><A
 
66
TITLE="Concurrency Control"
 
67
HREF="mvcc.html"
 
68
>Fast Backward</A
 
69
></TD
 
70
><TD
 
71
WIDTH="60%"
 
72
ALIGN="center"
 
73
VALIGN="bottom"
 
74
>Chapter 13. Concurrency Control</TD
 
75
><TD
 
76
WIDTH="10%"
 
77
ALIGN="right"
 
78
VALIGN="top"
 
79
><A
 
80
TITLE="Concurrency Control"
 
81
HREF="mvcc.html"
 
82
>Fast Forward</A
 
83
></TD
 
84
><TD
 
85
WIDTH="10%"
 
86
ALIGN="right"
 
87
VALIGN="top"
 
88
><A
 
89
TITLE="Transaction Isolation"
 
90
HREF="transaction-iso.html"
 
91
ACCESSKEY="N"
 
92
>Next</A
 
93
></TD
 
94
></TR
 
95
></TABLE
 
96
><HR
 
97
ALIGN="LEFT"
 
98
WIDTH="100%"></DIV
 
99
><DIV
 
100
CLASS="SECT1"
 
101
><H1
 
102
CLASS="SECT1"
 
103
><A
 
104
NAME="MVCC-INTRO"
 
105
>13.1. Introduction</A
 
106
></H1
 
107
><P
 
108
>    <SPAN
 
109
CLASS="PRODUCTNAME"
 
110
>PostgreSQL</SPAN
 
111
> provides a rich set of tools
 
112
    for developers to manage concurrent access to data.  Internally,
 
113
    data consistency is maintained by using a multiversion
 
114
    model (Multiversion Concurrency Control, <ACRONYM
 
115
CLASS="ACRONYM"
 
116
>MVCC</ACRONYM
 
117
>).
 
118
    This means that while querying a database each transaction sees
 
119
    a snapshot of data (a <I
 
120
CLASS="FIRSTTERM"
 
121
>database version</I
 
122
>)
 
123
    as it was some
 
124
    time ago, regardless of the current state of the underlying data.
 
125
    This protects the transaction from viewing inconsistent data that
 
126
    could be caused by (other) concurrent transaction updates on the same
 
127
    data rows, providing <I
 
128
CLASS="FIRSTTERM"
 
129
>transaction isolation</I
 
130
>
 
131
    for each database session.  <ACRONYM
 
132
CLASS="ACRONYM"
 
133
>MVCC</ACRONYM
 
134
>, by eschewing
 
135
    the locking methodologies of traditional database systems,
 
136
    minimizes lock contention in order to allow for reasonable
 
137
    performance in multiuser environments.
 
138
   </P
 
139
><P
 
140
>    The main advantage of using the <ACRONYM
 
141
CLASS="ACRONYM"
 
142
>MVCC</ACRONYM
 
143
> model of
 
144
    concurrency control rather than locking is that in
 
145
    <ACRONYM
 
146
CLASS="ACRONYM"
 
147
>MVCC</ACRONYM
 
148
> locks acquired for querying (reading) data
 
149
    do not conflict with locks acquired for writing data, and so
 
150
    reading never blocks writing and writing never blocks reading.
 
151
    <SPAN
 
152
CLASS="PRODUCTNAME"
 
153
>PostgreSQL</SPAN
 
154
> maintains this guarantee
 
155
    even when providing the strictest level of transaction
 
156
    isolation through the use of an innovative <I
 
157
CLASS="FIRSTTERM"
 
158
>Serializable
 
159
    Snapshot Isolation</I
 
160
> (<ACRONYM
 
161
CLASS="ACRONYM"
 
162
>SSI</ACRONYM
 
163
>) level.
 
164
   </P
 
165
><P
 
166
>    Table- and row-level locking facilities are also available in
 
167
    <SPAN
 
168
CLASS="PRODUCTNAME"
 
169
>PostgreSQL</SPAN
 
170
> for applications which don't
 
171
    generally need full transaction isolation and prefer to explicitly
 
172
    manage particular points of conflict.  However, proper
 
173
    use of <ACRONYM
 
174
CLASS="ACRONYM"
 
175
>MVCC</ACRONYM
 
176
> will generally provide better
 
177
    performance than locks.  In addition, application-defined advisory
 
178
    locks provide a mechanism for acquiring locks that are not tied
 
179
    to a single transaction.
 
180
   </P
 
181
></DIV
 
182
><DIV
 
183
CLASS="NAVFOOTER"
 
184
><HR
 
185
ALIGN="LEFT"
 
186
WIDTH="100%"><TABLE
 
187
SUMMARY="Footer navigation table"
 
188
WIDTH="100%"
 
189
BORDER="0"
 
190
CELLPADDING="0"
 
191
CELLSPACING="0"
 
192
><TR
 
193
><TD
 
194
WIDTH="33%"
 
195
ALIGN="left"
 
196
VALIGN="top"
 
197
><A
 
198
HREF="mvcc.html"
 
199
ACCESSKEY="P"
 
200
>Prev</A
 
201
></TD
 
202
><TD
 
203
WIDTH="34%"
 
204
ALIGN="center"
 
205
VALIGN="top"
 
206
><A
 
207
HREF="index.html"
 
208
ACCESSKEY="H"
 
209
>Home</A
 
210
></TD
 
211
><TD
 
212
WIDTH="33%"
 
213
ALIGN="right"
 
214
VALIGN="top"
 
215
><A
 
216
HREF="transaction-iso.html"
 
217
ACCESSKEY="N"
 
218
>Next</A
 
219
></TD
 
220
></TR
 
221
><TR
 
222
><TD
 
223
WIDTH="33%"
 
224
ALIGN="left"
 
225
VALIGN="top"
 
226
>Concurrency Control</TD
 
227
><TD
 
228
WIDTH="34%"
 
229
ALIGN="center"
 
230
VALIGN="top"
 
231
><A
 
232
HREF="mvcc.html"
 
233
ACCESSKEY="U"
 
234
>Up</A
 
235
></TD
 
236
><TD
 
237
WIDTH="33%"
 
238
ALIGN="right"
 
239
VALIGN="top"
 
240
>Transaction Isolation</TD
 
241
></TR
 
242
></TABLE
 
243
></DIV
 
244
></BODY
 
245
></HTML
 
246
>
 
 
b'\\ No newline at end of file'