So you're using a datamining application to generate the hand history files, yes?
Are the hands being imported for all the tables?
Are you using Beta 15?
You may want to try this:
Performance Tuning PostgreSQL.
Make sure you cluster/vacuum/analyse the database after this.
Also try the 'enhance HUD performance' option on the HUD Options.