From c65f29989493fccd7e0a08ead2435d57c5751dfe Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Mon, 28 Jun 2010 21:57:17 +0000 Subject: [PATCH] Add new Non-Durable Settings documentation section. Document that synchronous_commit can lose transactions in a db crash, not just a OS crash. --- doc/src/sgml/config.sgml | 5 +-- doc/src/sgml/perform.sgml | 64 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 66 insertions(+), 3 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index 174f981400..f218e698b2 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -1,4 +1,4 @@ - + Server Configuration @@ -1463,7 +1463,8 @@ SET ENABLE_SEQSCAN TO OFF; really guaranteed to be safe against a server crash. (The maximum delay is three times .) Unlike , setting this parameter to off - does not create any risk of database inconsistency: a crash might + does not create any risk of database inconsistency: an operating + system or database crash crash might result in some recent allegedly-committed transactions being lost, but the database state will be just the same as if those transactions had been aborted cleanly. So, turning synchronous_commit off diff --git a/doc/src/sgml/perform.sgml b/doc/src/sgml/perform.sgml index 4b6768bb69..10e38f2eb3 100644 --- a/doc/src/sgml/perform.sgml +++ b/doc/src/sgml/perform.sgml @@ -1,4 +1,4 @@ - + Performance Tips @@ -1104,4 +1104,66 @@ SELECT * FROM x, y, a, b, c WHERE something AND somethingelse; + + Non-Durable Settings + + + non-durable + + + + Durability is a database feature that guarantees the recording of + committed transactions even if if the server crashes or loses + power. However, durability adds significant database overhead, + so if your site does not require such a guarantee, + PostgreSQL can be configured to run + much faster. The following are configuration changes you can make + to improve performance in such cases; they do not invalidate + commit guarantees related to database crashes, only abrupt operating + system stoppage, except as mentioned below: + + + + + Place the database cluster's data directory in a memory-backed + file system (i.e. RAM disk). This eliminates all + database disk I/O, but limits data storage to the amount of + available memory (and perhaps swap). + + + + + + Turn off ; there is no need to flush + data to disk. + + + + + + Turn off ; there is no need + to guard against partial page writes. + + + + + + Increase and ; this reduces the frequency + of checkpoints, but increases the storage requirements of + /pg_xlog. + + + + + + Turn off ; there might be no + need to write the WAL to disk on every + commit. This does affect database crash transaction durability. + + + + + +