Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ian Smedley 97 posts 192 karma points
    Oct 25, 2012 @ 12:15
    Ian Smedley
    0

    Audit Trail Slow / Timesout - FIX!

    Here's a tip I thought I'd share.

    If you've got a particularly slow production SQL server, or a particularly large umbracoLog table - or a mixture of the two, then you may find that when trying to view the audit trail for a node, that it takes a very long time to show up, or worse, you get a YSOD because of a sql timeout.

    One solution would be to increase the timeout delay in Umbraco, Another solution would be to get a faster server. 

    However, I found a perfectly workable solution was to add a new Index designed specifically to speed up the Audit Log query.

    USE [DatabaseName]
    GO
    CREATE NONCLUSTERED INDEX [<Index Name, sysname,>]
    ON [dbo].[umbracoLog] ([NodeId],[logHeader])
    INCLUDE ([userId],[Datestamp],[logComment])
    GO
    
    This has meant the audit trail has gone from YSOD timeouts (total query execution time of circa 2 minutes) to the audit log displaying in 1 or 2 seconds..
    This was for Umbraco 4.04 - newer versions may be quicker, but I have yet to check this on other versions yet.
    Hopefully this may help someone else out... :-)
  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Apr 19, 2013 @ 13:45
    Anthony Dang
    0

    I've been researching ways to make the umbraco db a bit faster... do you have any other tips?

    The property data table gets enourmous with a large number of nodes... and the version and content xml tables are also quite large.

     

Please Sign in or register to post replies

Write your reply to:

Draft