speeding up tests with Postgres
speeding up tests with Postgres
Dear Lazyweb,
Im developing a site using Django and Postgres. How can I get my tests to run a lot faster?
Answer: tell Postgres to use a tablespace in RAM. Selects, updates, and inserts will run at fast RAM speed vs slow disk speed.
Caveat: this doesnt work for writes. Postgres is designed to keep data reliable at all times. Any INSERT/UPDATE/DELETE gets written to a "write-ahead log" (WAL), so that if the database crashed itll restore the data. Since this is on a disk no matter what the tablespace, the above trick doesnt work without defeating the WAL.
Answer2: use UNLOGGED tables, TBD.
Reference:
Unlogged table performance in postgresql 9.1: (2011) "unlogged tables have shown an increase of output by 13~17%"; includes performance-oriented Postgres settings.
WAITING FOR 9.1 � UNLOGGED TABLES (2011): "thats really fast"
wal_buffers performance by Robert Haas (2012): pretty graphs
download file now
Comments
Post a Comment