Share this:

Something interesting we discovered while testing list throttling in combination with large lists…

MSDN: ContentIterator class provides methods to iterate list items, lists, sites to regulate the amount of data that is transferred (i.e., to avoid throwing a SPQueryThrottledException).

We create lists with more than 5000 items, 10000 items, 50000 items and 150000 items, we used both the SPList.GetListItems as the contentIterator methodologies to retrieve data from these lists and there was quite an unexpected error, euhm issue…

First things first…
When using large lists in SharePoint you should make use of the best practices described at the following blog post and the following whitepapers.

list throttling will stop you from querying a list with more than 5K items in it, although you can change this setting in central administration… You don’t want to change this every time you hit this boundary!
In a scenario where you are 100% certain that there will be more than 5K items, there are possibilities to let your list grow to 50 million items and still be able to query the items you need. But this requires an extra property on your Microsoft.SharePoint.SPQuery object. The object I’m referring to is called QueryThrottleMode and allows you to overrule the list (view) throttling limits applied on the Web Application the code is run on.