Transaction Processing in PostgreSQL

Transaction Processing in PostgreSQL

Transaction Processing in PostgreSQL

Tom Lane

Great Bridge, LLC

tgl@sss.pgh.pa.us

1

30 Oct 2000 Tom Lane

Transaction Processing in PostgreSQL

Outline

Introduction ? What is a transaction?

User's view ? Multi-version concurrency control

Implementation ? Tuple visibility ? Storage management ? Locks

2

30 Oct 2000 Tom Lane

Transaction Processing in PostgreSQL

PostgreSQL system overview

Client Processes

Client Application

DB Requests and Results

via Library API

Client Interface Library

Initial Connection

Request and

Authentication

SQL Queries and Results

Server Processes

Postmaster Daemon Process

Spawn Server Process

Postgres Server

(Backend)

3

30 Oct 2000 Tom Lane

Transaction Processing in PostgreSQL

PostgreSQL system overview

Server Processes

Shared Memory Unix System

Postmaster

Daemon Process

Create

Spawn Server Process

Postgres Server

(Backend)

Read/ Write

Shared Disk

Buffers

Shared Tables

Kernel Disk Buffers

Disk Storage

? Database files are accessed through shared buffer pool ? Hence, two backends can never see inconsistent views of a file

? Unix kernel usually provides additional buffering 4

30 Oct 2000 Tom Lane

Transaction Processing in PostgreSQL

What is a transaction, anyway?

Definition: a transaction is a group of SQLcommands whose results will be made visible to the rest of the system as aunit when the transaction commits --- or not at all, if the transaction aborts. Transactions are expected to be atomic, consistent,isolated, and durable.

? Postgres does not support distributed transactions, so all commandsof a transaction are executed by one backend. ? We don't currently handle nested transactions, either.

5

30 Oct 2000 Tom Lane

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download