Main reference for tuning:
http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server
Most importantly you should make sure you have a way of measuring performance first, and then when you try new changes try them one at a time, gather data (3-5 samples are a good start, you might need to run tests a few times to get take into account cache priming) then compare with old settings.
The most important principle is, the less disk IO the better. So if we have the correct indexing, it works less to find an answer. If you can cache data into RAM, that even better, as the disk IO will be less frequent.
So focus on: