> For the complete documentation index, see [llms.txt](https://docs.postgresql.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.postgresql.tw/11/the-sql-language/performance-tips/14.5.-dan-xing-she-ding.md).

# 14.5. 彈性設定

Durability is a database feature that guarantees the recording of committed transactions even if the server crashes or loses power. However, durability adds significant database overhead, so if your site does not require such a guarantee,PostgreSQLcan be configured to run much faster. The following are configuration changes you can make to improve performance in such cases. Except as noted below, durability is still guaranteed in case of a crash of the database software; only abrupt operating system stoppage creates a risk of data loss or corruption when these settings are used.

* Place the database cluster's data directory in a memory-backed file system (i.e.RAMdisk). This eliminates all database disk I/O, but limits data storage to the amount of available memory (and perhaps swap).
* Turn off[fsync](https://www.postgresql.org/docs/10/static/runtime-config-wal.html#guc-fsync); there is no need to flush data to disk.
* Turn off[synchronous\_commit](https://www.postgresql.org/docs/10/static/runtime-config-wal.html#guc-synchronous-commit); there might be no need to forceWALwrites to disk on every commit. This setting does risk transaction loss (though not data corruption) in case of a crash of the*database*.
* Turn off[full\_page\_writes](https://www.postgresql.org/docs/10/static/runtime-config-wal.html#guc-full-page-writes); there is no need to guard against partial page writes.
* Increase[max\_wal\_size](https://www.postgresql.org/docs/10/static/runtime-config-wal.html#guc-max-wal-size)and[checkpoint\_timeout](https://www.postgresql.org/docs/10/static/runtime-config-wal.html#guc-checkpoint-timeout); this reduces the frequency of checkpoints, but increases the storage requirements of`/pg_wal`.
* Create[unlogged tables](https://www.postgresql.org/docs/10/static/sql-createtable.html#sql-createtable-unlogged)to avoidWALwrites, though it makes the tables non-crash-safe.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.postgresql.tw/11/the-sql-language/performance-tips/14.5.-dan-xing-she-ding.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
