Announcement

Collapse
No announcement yet.

Aggressive attachment pruning

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.
Working...
X