Sharepoint - What are good ways around the List View Threshold?

To avoid the listview threshold, you need to index columns in your library and query against that column. So long as the number of rows returned in your query is below the listview threshold, you won't get the exception.

As an example, I hit this problem when trying to retrieve all the folders in a SharePoint library. The number of folders was well below 5000 (the default listview threshold), but with over 20,000 items in the library, I was triggering the exception.

The solution was to index Content Type (accessible through SharePoint library settings) and use the following query:

<Where><BeginsWith><FieldRef Name='ContentTypeId' /><Value Type='ContentTypeId'>0x0120</Value></BeginsWith></Where>

You just have to figure out how to ensure your query will return less than the listview threshold.


In Central Administration you can disable the list threshold completely, or set a higher limit. You can also set a time window when the limit is disabled and run your report service then. Go to the web application management page in central administration and select the Resource Throttling option from the General Settings button in the ribbon.

If you CAML query a list with a filter such that it returns less items than the threshold that should also work.


You can use the ContentIterator class to bypass the list view threshold, but you would need to resort to custom code to fetch the data.

Documentation: "Provides methods to iterate list items, lists, sites to regulate the amount of data that is transferred (i.e., to avoid throwing a SPQueryThrottledException)."