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.
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.
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.
is working on a reply...