[rt-users] Huge Attachments.MYD file

Duane Waddle dwaddle at charter.net
Mon May 6 12:46:58 EDT 2002


At 5/1/2002 10:37 AM, you wrote:

>I don't know if there's an easy way to search for this (there isn't in the
>web application, but maybe through your database there's an easy query).

Using RT 2-0-13 w/ MySql.. try this query.  Should give you all attachments 
and the ticket # associated, sorted by attachment size.

select b.Ticket,a.Filename,length(a.Content) as attachsz from Attachments 
a, Transactions b where a.TransactionId=b.id and length(a.Content) is not 
null order by attachsz desc;


Now the kicker here is that you'll know where the pigs in your database are 
--   but is there a clean and easy way to delete them?  My present guess is 
there is not.  (Clean and easy here refer to a technique that RT would 
provide and Jesse wouldn't frown on.)

Hope this helps

--D





More information about the rt-users mailing list