wal_autocheckpoint
WAL size, in pages, at which a commit triggers an automatic checkpoint; 0 or less disables it.
- 기본값
1000 pages- Range
- Any integer; 0 or negative disables
- Restart needed
- 아니요
- Default checked on
- SQLite 3.5x
기능
A checkpoint copies WAL content back into the database file. It can only finish up to the oldest active reader, so a long-running read lets the WAL grow without bound.
기본값
1000 pages. 1000 pages, about 4MB with 4KB pages (a stock SQLite 3.5x build).
Check the current value
PRAGMA wal_autocheckpoint;
Change it
PRAGMA wal_autocheckpoint = 10000; -- this connection only
No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.
When to change it
Raise it for bursty write loads; disable it only if your application runs PRAGMA wal_checkpoint(TRUNCATE) itself.
What can go wrong
With checkpoints disabled or blocked by readers, the -wal file keeps growing and reads get slower.
The closest setting on other engines
| 엔진 | 설정 | 기본값 | Restart |
|---|---|---|---|
| SQLite |
wal_autocheckpoint this page
|
1000 pages |
아니요 |
| PostgreSQL |
max_wal_size
|
1GB |
아니요 |
| MySQL |
innodb_redo_log_capacity
|
100MB |
아니요 |
| SQL Server |
TARGET_RECOVERY_TIME
|
60 SECONDS |
아니요 |
| Oracle |
fast_start_mttr_target
|
0 |
아니요 |
Questions about wal_autocheckpoint
What is the default value of wal_autocheckpoint in SQLite?
1000 pages. 1000 pages, about 4MB with 4KB pages (a stock SQLite 3.5x build).
Does changing wal_autocheckpoint require a restart?
No. No restart. It applies at once to the connection that runs it and is lost when that connection closes, so set it every time a connection opens.
When should I change wal_autocheckpoint?
Raise it for bursty write loads; disable it only if your application runs PRAGMA wal_checkpoint(TRUNCATE) itself.
Back to all SQLite settings, or check the SQLite manual for every option.
Check wal_autocheckpoint on your own server
SQLly runs the query above against SQLite and the other engines in this reference, from one desktop app on macOS, Windows and Linux.