Sunday, November 18, 2007

Large content databases - added indexes for performance improvements

Everyone that has inspected SharePoint's content database will notice that all lists and documents are stored in two tables only, AllUserData and AllDocs.

As only a few properties are contained in indexes searches will most likely lead to table-scans. Having a few 1.000 documents in SharePoint might not lead to slow performance but if you're looking at 100.000+ documents the situation is obviously different as outlined in this excellent article.

Thursday, November 08, 2007

Potentially excessive number of SPRequest objects currently unreleased on thread

Hopefully you'll never come across the error "Potentially excessive number of SPRequest objects (35) currently unreleased on thread 5". It seems it can occur in several situations due to issues in your code as well as due to issues within Microsoft Office SharePoint Server 2007.

In order to avoid the problem in your code ensure to properly dispose the SPWeb object as outlined in this Microsoft article as well as in this blog. One important thing missing is the SPWeb.Webs() object - if using this object you also need to dispose all webs within the collection.

Potential reasons include:

Friday, November 02, 2007

SharePoint Content Database

In case you wish to modify the SharePoint Content Database through SQL rather than using Microsoft SharePoint API you might wish to start reading this blog.

Where is my content type used

If you have worked extensively with MOSS content types you have been in situations where you couldn't locate where the content type was used. Thanks for this blog you can now use the SQL below to retrieve that information.

DECLARE @ContentTypeName nvarchar(128)
SET @ContentTypeName='Document'
SELECT w.Title AS [Web Site], w.FullUrl AS [Web Url], al.tp_Title AS [List Title], ct2.* FROM ContentTypes ct1 JOIN ContentTypes ct2 ON LEFT(ct2.ContentTypeId, Len(ct1.ContentTypeId))=ct1.ContentTypeId LEFT OUTER JOIN dbo.ContentTypeUsage ctu ON LEFT(ctu.ContentTypeId, Len(ct2.ContentTypeId)) = ct2.ContentTypeId LEFT OUTER JOIN dbo.AllLists al ON ctu.ListId = al.tp_Id AND ctu.WebId=al.tp_WebId LEFT OUTER JOIN dbo.Webs w ON al.tp_WebId = w.Id WHERE ct1.ResourceDir=@ContentTypeName