List Item Threshold Explained
Many of us already know the story with the 5,000 item limit with lists/libraries and some strategies to work around this limitation.
A lot of administrators when faced with the familiar "the number of items in this list exceeds the list view threshold" will naturally navigate to Central Admin and modify the Resource Throttling for the web application.
- Select the proper web application and then General Settings -> Resource Throttling.
- Once in the Resource Throttling page, you can adjust the list view threshold for users and admins.
Be careful when doing this because when you select the web application, the settings affect all list and libraries in that web application.
PowerShell to the rescue
SharePoint administrators with PowerShell privileges you can modify thresholds on a list by list basis avoiding web application wide thresholds. There are a few things to consider.
- The "IsThrottled" cmdlet is a Boolean that indicates if a list has been throttled. Consider the following command:
$web = get-spweb https://sp
$list = $web.lists["test"]
$list.IsThrottled
This will always return false for lists fewer than 5,000 items (or central admin settings if overridden)
2. As soon as item 5001 is added then normal users will see the "this view cannot be displayed because it exceeds the list view threshold" message on the top of the list:
A couple things to note when the 5001 mark is met:
1. When an administrator accesses the list, they will still be bound to the list view threshold set in Central Administration. In our example it's 20,000 so they see the list items fine.
2. When you re-run the PowerShell command above, now the Boolean value returned is true, indicating the list is now being throttled.
3. To disable list throttling for the specified list, run the following PowerShell command:
$web = get-spweb https://sp
$list = $web.lists["test"]
$list.EnableThrottling = $false
$list.Update()
4. Now when you run the $list.IsThrottled command, it will return false, indicating the list is no longer being throttled. Users will now be able to see all the items in the list without the error message.
Calendars are different
When working with calendars, depending on the view that you select depends on the results you'll see. Remember a calendar is nothing more than a list with some fancy views on top of it. Consider the following:
- If a regular user goes into the All Events view and there are more than 5,000 items, they will see the list item threshold error.
- If the same user goes into a specific calendar month that has more than 5,000 items, it will display just fine.
3. If you click on the 5003 more items link it will expand and show all 5003 items (yes it does scroll forever!).
4. When you page through the monthly view it does make a SQL call to the database. I ran a SQL profile trace and it will use the beginning and ending day of that month to retrieve the results. You do see some latency when going from page to page.
NOTE:
- Plan your indexing as part of the list/library planning. If you try to create an index when the list is over the threshold, you will get a "Something went wrong" error.
- If you have grouping on your list, you still need to conform to the list view threshold requirements.
Resources: