Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Speed up PostGreSQL createdb?

Is there a way to speed up PostgreSQL's createdb command?

Normally I wouldn't care, but doing unit testing in Django creates a database every time, and it takes about 5 seconds.

I'm using openSUSE 11.2 64-bit, PostgreSQL 8.4.2

like image 761
John Avatar asked Mar 12 '10 05:03

John


1 Answers

It won't help you now, but there has been some work done around this in PostgreSQL 9.0.`

What you can try as a workaround is to run with fsync=off. Of course, don't even think about doing this if you have actual data in your database, but if it runs on a test system only, that will make your CREATE DATABASE run a lot faster.

like image 158
Magnus Hagander Avatar answered Sep 30 '22 22:09

Magnus Hagander