0

Looks like my SharePoint code is generating SQL, it runs 3 to 4 times per page request. It all adds up to approximately 4 seconds from what I can see on the developer dashboard. I'm using spmonitored scope in my methods but non of the executions times correlate with the db execution time.

The query starts off as

SELECT t39.*, t40.[ntext8] ... etc

The tables being queries are: 'AllUserData' 'AllDocs' 'Worktable' 'AllUserDataJunctions'

how can I trace this back to my code?

Thanks, Cody.

1 Answer 1

0

You can try add some Microsoft.SharePoint.Utilities.SPMonitoredScope to your code. With them you can measure a part of your code. The Developer Dashboard shows the time used for this scopes.

Use this with a using statment around the code of want to measure:

using (new SPMonitoredScope("My Scope Name"))
{
   doSomeWork(); 
}

See msdn: Using SPMonitoredScope for details.

1
  • Already have spmonitored scope in there
    – codys-hole
    Commented Jul 30, 2015 at 11:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.