[Rt-devel] PATCH [2 files] - Re: [rt-users] Performance with many attachments and transactions

Stephen Turner sturner at MIT.EDU
Mon Nov 28 17:19:22 EST 2005


At Monday 11/28/2005 03:06 PM, Jesse Vincent wrote:
> > What would be relatively simple though (I think), is to add a "size less
> > than MaxInlineBody" limit to the query that gets text attachments. Would
> > that be enough?
>
>That was along the lines of what I was thinking. Though I have a nagging
>feeling that soem database or other is going to turn this into an even
>slower query, possibly by taking the attachments out of the database,
>normalizing them to utf-7, counting the bits in each and then summing
>the bits using a stored procedure coded in TCL.

I gave up on the idea of trying to get the query to limit the content size. 
Transaction->ContentLength doesn't simply use the length of the content 
field and I couldn't figure out how to build a query to emulate that logic.

What I did was filter the ticket's attachment content cache further so that 
attachments with a filename aren't fetched. I also used Kevin's mod to 
prevent attachments with filenames from being displayed. I also removed the 
HTML code that causes image attachments to be displayed inline. I commented 
it out rather than just deleting it, as I thought this might be an optional 
feature so if it needs to be reinstated
inside an if statement, it would be easier to uncomment it than to reinvent 
the code.

Functionally, these patches will prevent inline display of text attachments 
with filenames (and prevent them from being needlessly fetched from the 
database) and will also prevent inline display of image attachments.

Anyway, 2 patches attached.

These are against RT 3.4.2

Steve 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ShowTransactionAttachments.patch
Type: application/octet-stream
Size: 886 bytes
Desc: not available
Url : http://lists.bestpractical.com/pipermail/rt-devel/attachments/20051128/da48385d/ShowTransactionAttachments.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LoadTextAttachments.patch
Type: application/octet-stream
Size: 578 bytes
Desc: not available
Url : http://lists.bestpractical.com/pipermail/rt-devel/attachments/20051128/da48385d/LoadTextAttachments.obj


More information about the Rt-devel mailing list