Rowan replied very well to your question, but I'm alarmed that you have unexpected access. Ignoring this new <code>VACUUM</code> you want to add, do you have one connection being used by many threads, or many connections ? Have you set a timeout on every connection to the database ? If not, you should do, and this will reduce access clashes.