Article ID: 2597043 - View products that this article applies to.
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.
To resolve this issue, apply the following update:
(http://support.microsoft.com/kb/2596998/ )Description of the SharePoint Foundation 2010 hotfix package (Sts-x-none.msp): December 13, 2011
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.