joepie Platteau <joepie.Platteau@kulak.ac.be> writes:
> shared_buffers = 128
Try boosting that to 1000 or so. The default sort_mem is on the miserly
side as well; you could try 5000 or 10000 for that.
But probably a more important bit of advice is to run ANALYZE. I think
most likely Postgres is choosing a bad query plan because it doesn't
have any statistics about the table contents.
If ANALYZE doesn't help, let's see the output of EXPLAIN ANALYZE for the
problem query.
regards, tom lane