Symptoms
The proc_GetContentTypeIdFromUrl stored procedure takes a long time to retrieve the content type identifier of a document if many documents are in a SharePoint Foundation 2010 site.
Resolution
To resolve this issue, apply the following update:
2596998 Description of the SharePoint Foundation 2010 hotfix package (Sts-x-none.msp): December 13, 2011
Status
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.