your question is rather unspecific...
Here is a fine document on postgres software tuning http://www.argudo.org/postgresql/soft-tuning.html.
You can of course also tune your server hardware http://www.ca.postgresql.org/docs/momjian/hw_performance/
hope that helps a bit, peter