Tuning PostgreSQL queries

There are no hard and fast rules when it comes to optimizing sql queries.