X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FShredder.pm;h=e4cb157aefb4054fb7c334ac42d936dda58c6d42;hb=919e930aa9279b3c5cd12b593889cd6de79d67bf;hp=4f96e162d0f86379194f92dec90b53a30210d982;hpb=0bff2e665b3a6389b47510e4c04a5a454f6dd7d4;p=freeside.git diff --git a/rt/lib/RT/Shredder.pm b/rt/lib/RT/Shredder.pm index 4f96e162d..e4cb157ae 100644 --- a/rt/lib/RT/Shredder.pm +++ b/rt/lib/RT/Shredder.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -164,6 +164,23 @@ your F: Be sure to specify an absolute path. +=head1 Database Indexes + +We have found that the following indexes significantly speed up +shredding on most databases. + + CREATE INDEX SHREDDER_CGM1 ON CachedGroupMembers(MemberId, GroupId, Disabled); + CREATE INDEX SHREDDER_CGM2 ON CachedGroupMembers(ImmediateParentId,MemberId); + CREATE INDEX SHREDDER_CGM3 on CachedGroupMembers (Via, Id); + + CREATE UNIQUE INDEX SHREDDER_GM1 ON GroupMembers(MemberId, GroupId); + + CREATE INDEX SHREDDER_TXN1 ON Transactions(ReferenceType, OldReference); + CREATE INDEX SHREDDER_TXN2 ON Transactions(ReferenceType, NewReference); + CREATE INDEX SHREDDER_TXN3 ON Transactions(Type, OldValue); + CREATE INDEX SHREDDER_TXN4 ON Transactions(Type, NewValue); + + CREATE INDEX SHREDDER_ATTACHMENTS1 ON Attachments(Creator); =head1 INFORMATION FOR DEVELOPERS @@ -720,7 +737,7 @@ sub GetFileName =head4 StoragePath Returns an absolute path to the storage dir. See -L. +L. See also description of the L method.