[rt-users] another useful index

Vick Khera khera at kcilink.com
Wed Oct 27 14:13:23 EDT 2010


After our upgrade to 3.8.8 today, I spent some time to figure out why some things are still slow.  Of particular note it was really really slow to reply to a specific correspondence on a ticket with lots of attachments.  I noticed that RT was just spending all of that time waiting on this query:

SELECT main.* FROM Attachments main  WHERE (main.Content IS NOT NULL AND main.Content != '') AND (main.Parent = '1429741') AND (main.ContentType = 'text/plain')  ORDER BY main.id ASC

On my attachments table with 1.2 million rows, this is doing a sequence scan.  I added an index on the Parent field, and now it is nearly instant, and normal page loads seem to be a bit faster as well.




More information about the rt-users mailing list