web stats
Mirth Community - View Single Post - Aggressive attachment pruning
View Single Post
  #1  
Old 09-30-2013, 11:21 AM
sandersmr sandersmr is offline
OBX.2 Kenobi
 
Join Date: Feb 2013
Posts: 71
sandersmr is on a distinguished road
Default Aggressive attachment pruning

So, I have two channels that use attachments for MDM documents. I used to have pruning set to run hourly, but after some issues I've changed it to daily around 1 am, to hopefully help. The issue is that pruning of the attachments table seems to be overly aggressive. When checking the process list, the CPU usage is sitting at about 95% used and I have about 8 or so postgres processes all running the same query, many running for 2+ hours:

Code:
DELETE FROM ATTACHMENT WHERE MESSAGE_ID NOT IN (SELECT ID FROM MESSAGE WHERE ATTACHMENT=TRUE UNION SELECT CORRELATION_ID FROM MESSAGE WHERE CORRELATION_ID IS NOT NULL AND ATTACHMENT=TRUE)
I realize that this is for pruning the attachments table of unneeded attachments, but from what I see, you only need one of those running, not 8+. I've tried canceling them, but they keep coming back a few minutes later.

Any suggestions? I'm using PostgreSQL 8.4 and Mirth 2.1.1.
Reply With Quote