Yep, if you don't mind losing commits if postgres crashes or is restarted uncleanly, you can set:
You can also use UNLOGGED
tables.
If you're willing to completely re-create the postgres install (re-initdb
) after a crash, you can further set:
fsync = off
(WARNING, will cause data corruption if host crashes)
full_page_writes = off
(WARNING, may cause data corruption if host crashes)
For more tips, see my SO reply optimise postgres for fast testing.
There is no point trying to use a ramdisk. Just use unlogged tables, tune your checkpoints to happen infrequently, and turn off fsync and full page writes if you want non-durable data. Postgres and the OS won't write things to disk unless it needs to free memory, but are free to do so if they need memory for other things. It'll usually perform better than a pure ramdisk.