We have a SharePoint list containing 50,000 items, and you want to get some data from it without disabling the default setting of SP2010.
From MSDN for processing large lists, we determined that the key ingredient would be to use a small RowLimit in SPQuery and use ListItemCollectionPosition for batch processing.
However, with our code (something) like this, a throttling exception still fires:
SPQuery query = new SPQuery(); query.Query = "<Where><Contains><FieldRef Name=\"MatterName\" /><Value Type=\"Text\">7476922</Value></Contains></Where>"; query.ViewFields = "<FieldRef Name=\"MatterName\"/>"; query.RowLimit = 10; int index = 0; do { SPListItemCollection batch = mattersList.GetItems( query ); query.ListItemCollectionPosition = batch.ListItemCollectionPosition; } while ( query.ListItemCollectionPosition != null );
According to MVP experts in SharePoint Connections 2010, this is by design, since implicit sorting by the result set will still cause a throttling threshold of 5000.
Which is good and all, but then how do we get from this list? Would ContentIterator use a better option? If so, what is the magic that the content iterator will use to make this happen?
source share