バージョンごとのドキュメント一覧

13.1. はじめに #

<title>Introduction</title>

<productname>PostgreSQL</productname> provides a rich set of tools for developers to manage concurrent access to data. Internally, data consistency is maintained by using a multiversion model (Multiversion Concurrency Control, <acronym>MVCC</acronym>). This means that each SQL statement sees a snapshot of data (a <firstterm>database version</firstterm>) as it was some time ago, regardless of the current state of the underlying data. This prevents statements from viewing inconsistent data produced by concurrent transactions performing updates on the same data rows, providing <firstterm>transaction isolation</firstterm> for each database session. <acronym>MVCC</acronym>, by eschewing the locking methodologies of traditional database systems, minimizes lock contention in order to allow for reasonable performance in multiuser environments. PostgreSQLは、データへの同時アクセスを管理するために高度な開発者向けツール群を提供します。 内部的に、データ一貫性は多版方式(多版型同時実行制御MVCC)を使用して管理されています。 つまり、処理の基礎となっているデータの現在の状態にかかわらず、各SQL文は遡ったある時点におけるスナップショット(データベースバージョン)を参照する、というものです。 これは、同時に並行しているトランザクションが同じ行を更新することによって引き起こす整合性を欠いたデータの参照を文にさせないようにし、それぞれのデータベースセッションに対してトランザクションの分離を提供します。 MVCCは、マルチユーザ環境で理想的な性能を得るために、伝統的なデータベースシステムで行われるようなロック手法を避けることで、ロックの競合を最小化します。

The main advantage of using the <acronym>MVCC</acronym> model of concurrency control rather than locking is that in <acronym>MVCC</acronym> locks acquired for querying (reading) data do not conflict with locks acquired for writing data, and so reading never blocks writing and writing never blocks reading. <productname>PostgreSQL</productname> maintains this guarantee even when providing the strictest level of transaction isolation through the use of an innovative <firstterm>Serializable Snapshot Isolation</firstterm> (<acronym>SSI</acronym>) level. ロックではなく同時実行制御のMVCCモデルを使用する主な利点は、MVCCでは問い合わせ(読み込み)ロックの獲得と、書き込みロックの獲得が競合しないことです。 したがって、読み込みは書き込みを絶対にブロックしませんし、書き込みも読み込みをブロックすることがありません。 革新的なシリアライザブルスナップショット分離 (SSI)レベルの使用を通した最も厳密なトランザクションの分離レベルを提供する場合にもPostgreSQLはこれの保証を維持します。

Table- and row-level locking facilities are also available in <productname>PostgreSQL</productname> for applications which don't generally need full transaction isolation and prefer to explicitly manage particular points of conflict. However, proper use of <acronym>MVCC</acronym> will generally provide better performance than locks. In addition, application-defined advisory locks provide a mechanism for acquiring locks that are not tied to a single transaction. 全般的に完全なトランザクションの分離を必要とせず、明示的に競合する点を管理することを望むアプリケーションのために、PostgreSQLではテーブルレベルおよび行レベルのロック機能も使用可能です。 とはいえ、MVCCを適切に使用すると通常ロックよりも性能が向上します。 さらに、アプリケーションが定義した勧告的ロックは単一トランザクションに拘束されないロックの獲得機構を提供します。