I have just installed Postgres 9.1 on a server with 32GB of RAM and 320GB solid-state disk.
I will be using this server to serve both my site and my database (i.e. it's not just a database server). The database is 500m rows, approximately 120GB of data.
Once the data is loaded, the database needs to be optimised for SELECT queries - the data is fairly static in nature, and only changes once every three months. 99% of the queries made to the database will be reads.
I'm wondering what would be good Postgres settings to start out with. I've set:
effective_cache_size 8GB
shared_buffers 4GB
in the Postgres config file, but I haven't touched any of the other defaults.
With the settings above, I'm finding it very slow (more than an hour and still running) to create an index on one field in my table, and I want to create many of them.
Are there other settings I could look at to make index creation faster? Or can I safely increase these settings?
shared_buffers
to approximately 12.8GB. This will improve the select performance according to my believe.