Detailed Insight On The SharePoint 5000 List View Threshold Limit Issue (2024)

Introduction

The threshold concept was introduced in SharePoint 2010 considering the performance issue while loading a big list to improve the query performance. There is an incorrect perception about the SharePoint list view threshold 5000 error - many users think that the SharePoint list/library just can store 5000 items but that is not true, in fact, SharePoint list can store 30 million items. Then why are we getting this error? Before we analyze about this error I recommend you to read my previous articles "Overview Of SharePoint Column Indexing" and "Creating Indexed Column In SharePoint"

Why do we get a 5000 threshold error?

This error actually comes from SQL, not from SharePoint. As I have explained in my previous article "Overview Of SharePoint Column Indexing" there we have seen that the SharePoint stores all of its list data and list columns in single SQL table, i.e. "AllUserData" table.

Now we need to learn how the query gets processed.

When we browse a list or library SharePoint sends a query to SQL and SQL process that query and send the result to SharePoint, then finally we can see the result i.e. nothing but list or library items in the browser. Let's take an example of "All Items" view (assuming that no filters were applied on it) - when we click on this view SharePoint will build a query and pass this on to SQL, then SQL processes that query and sends the result to SharePoint. Now if the results returned by the query are more than 5000 then the user gets the below-mentioned list view threshold error.

Detailed Insight On The SharePoint 5000 List View Threshold Limit Issue (1)

Why does this limitation set as 5,000 in SQL?

Due to the performance reasons, if SQL server performs the query on a single table (here it is: “AllUserData” table) which would result in the output being more than 5000 items, in this case, the SQL server will lock the entire table while the query execution is on – this is the default behavior of SQL by the designed.

So when the "AllUserData" table is locked – what will happen?

So far as we have learned that SharePoint stores all list/library data in a single table i.e “AllUserData” – a single query which returns more than 5,000 items will lock all of the list and library data for that entire content database.

In this scenario – the business users who were accessing content in SharePoint from the same content site collection (content database) while the “AllUserData” table is locked, will have to wait a longer time for their results to be displayed.

By now we have learned about the root cause of threshold error and we need to focus on how to move on with this situation as the business has to run.

How to overcome the 5000 items list view threshold issue?

We can increase the list items limit from 5000 to 50000 (fifty thousand) in SharePoint on-premise, in fact, we can disable the list view threshold limit which is not all recommended but in SharePoint online we don’t have control over it, so we need to move on with the whatever limitation is set i.e. 5000.

Here based on my experience, I will list out some tips and tricks to avoid this issue which will work both for SharePoint online and on-premise.

  • Planning – before creating the list or library, analyze the data and plan accordingly. Try to split the data in multiple list or library.
  • Create multiple views and add “AND” condition in the list filter criteria, never add “OR” condition, “OR” condition will try to get all data.
  • Create index column – we can only have 20 indexed columns in a given list, so we need to plan this thoughtfully!
  • We cannot create an indexed column if the list is already hitting the list view threshold limit.
  • Maintain the archive list – here we need to review the list items periodically and need to check whether some items can be deleted or archived to another list – here we can write some automation job which will be moving the items periodically to another archive list automatically.
  • In the list filter criteria, we need to filter the list items such a way that at any given point of time list view will return less than 5000 items using filter on created column column technique(please see the explanation in the below).

Create filter using [Today]- "<number of days>" technique

Here one of the techniques is – create a filter on "Created" column and use the [Today]- “number of days” with less than or equal to condition, something like below:

Detailed Insight On The SharePoint 5000 List View Threshold Limit Issue (2)

Note:The logic behind the filter on the created column is – this will try to get the items that will return less than 5000 items. If this condition also returns more than 5000 items, we need to split this up created column condition with multiple “AND” condition with the combination of some other column to ensure the filter returns less than 5000 items as a below example – though the implementation of this technique is time consuming.

Detailed Insight On The SharePoint 5000 List View Threshold Limit Issue (3)

Practically – let us see what happens when a list exceeds the 5000 items

To check this we need to have a list which should have more than 5000 items. So I have created a list named "Test List" were adding more than 5000 items using the below PowerShell script to see what happens when it crosses the 5000 limit.

  1. CLS
  2. #LoadSharePointCSOMAssemblies
  3. #Add-Type-Path"C:\ProgramFiles\CommonFiles\MicrosoftShared\WebServerExtensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
  4. #Add-Type-Path"C:\ProgramFiles\CommonFiles\MicrosoftShared\WebServerExtensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
  5. $fileName="Adding_Multiple_Items_Report"
  6. $enddate=(Get-Date).tostring("yyyyMMddhhmmss")
  7. $logFileName=$fileName+"_"+$enddate+"_Log.txt"
  8. $invocation=(Get-VariableMyInvocation).Value
  9. $directoryPath=Split-Path$invocation.MyCommand.Path
  10. $directoryPathForLog=$directoryPath+"\"+"LogFiles"
  11. if(!(Test-Path-path$directoryPathForLog))
  12. {
  13. New-Item-ItemTypedirectory-Path$directoryPathForLog
  14. }
  15. $logPath=$directoryPathForLog+"\"+$logFileName
  16. $isLogFileCreated=$False
  17. #DLLlocation
  18. $directoryPathForDLL=$directoryPath+"\"+"DependencyFiles"
  19. if(!(Test-Path-path$directoryPathForDLL))
  20. {
  21. New-Item-ItemTypedirectory-Path$directoryPathForDLL
  22. }
  23. #DLLlocation
  24. $clientDLL=$directoryPathForDLL+"\"+"Microsoft.SharePoint.Client.dll"
  25. $clientDLLRuntime=$directoryPathForDLL+"\"+"Microsoft.SharePoint.Client.dll"
  26. Add-Type-Path$clientDLL
  27. Add-Type-Path$clientDLLRuntime
  28. functionWrite-Log([string]$logMsg)
  29. {
  30. if(!$isLogFileCreated){
  31. Write-Host"CreatingLogFile..."
  32. if(!(Test-Path-path$directoryPath))
  33. {
  34. Write-Host"PleaseProvideProperLogPath"-ForegroundColorRed
  35. }
  36. else
  37. {
  38. $script:isLogFileCreated=$True
  39. Write-Host"LogFile($logFileName)Created..."
  40. [string]$logMessage=[System.String]::Format("[$(Get-Date)]-{0}",$logMsg)
  41. Add-Content-Path$logPath-Value$logMessage
  42. }
  43. }
  44. else
  45. {
  46. [string]$logMessage=[System.String]::Format("[$(Get-Date)]-{0}",$logMsg)
  47. Add-Content-Path$logPath-Value$logMessage
  48. }
  49. }
  50. #variablesregion.
  51. $siteURL="https://globalsharepoint.sharepoint.com/sites/TestSite/"
  52. $spUserName="[emailprotected]"
  53. $password="ThisIsTestPassWord"
  54. $spListName="TestList"
  55. #$numberOfItemsToCreate="5001"
  56. #variablesregionend.
  57. $securePassword=$Password|ConvertTo-SecureString-AsPlainText-Force
  58. #SetuptheContext
  59. try
  60. {
  61. $ctx=New-ObjectMicrosoft.SharePoint.Client.ClientContext($siteURL)
  62. $ctx.Credentials=New-ObjectMicrosoft.SharePoint.Client.SharePointOnlineCredentials($spUserName,$securePassword)
  63. #Getthelist
  64. $spList=$ctx.Web.Lists.GetByTitle($spListName)
  65. $ctx.Load($spList)
  66. $ctx.ExecuteQuery()
  67. #Loopthrutocreatethelistitems.
  68. for($i=1;$i-le5001;$i++)
  69. {
  70. $listItemCreationInformationInSPOnline=New-ObjectMicrosoft.SharePoint.Client.ListItemCreationInformation
  71. $newListItemInSPOnline=$spList.AddItem($listItemCreationInformationInSPOnline)
  72. $newListItemInSPOnline["Title"]="CustomItemNumberAddedThruCode_1_$($i)"
  73. $newListItemInSPOnline["CustomItemNumber"]=$i;
  74. $newListItemInSPOnline.Update()
  75. $ctx.ExecuteQuery()
  76. write-host"ItemcreatedinSPOnlinelist:$spListNameCustomItemNumberAddedThruCode_$($i)"
  77. }
  78. }
  79. catch
  80. {
  81. $errorMessage=$_.Exception.Message+"inaddingmulitpleitemsinSPOnlinelistusingCSOMPowerShellscript";
  82. Write-Host$errorMessage-BackgroundColorRed
  83. Write-Log$errorMessage
  84. }
  85. Write-Host"####################################################################"-ForegroundColorGreen
  86. Write-Host"Thescriptexecutionhasbeencompleted!"-ForegroundColorGreen
  87. Write-Host"###################################################################"

Execute the above script like below:

Detailed Insight On The SharePoint 5000 List View Threshold Limit Issue (4)

Now if we go the list setting page (example as “Test List”), we can see the message like below which says this list exceeds the 5000 threshold limit.

Detailed Insight On The SharePoint 5000 List View Threshold Limit Issue (5)

Is the 5000 limitation for all users?

No, 5000 limation is for the normal users and for the administrator limitation is higher; i.e., 20000.

What does it mean?

When a normal user accesses a SharePoint list which has more than 5000 items, that user will get a 5000 listview threshold error mentioned above and list will not be opened with the data but the same list will be loaded with the data if it accessed by an administrator as it has higher limit i.e. 20000.

Summary

Thus, in this article we have learned the below concept with respect to SharePoint list view threshold:

  • What is the threshold issue in SharePoint list.
  • Why do we get a 5000 threshold error?
  • Why does this limitation set as 5,000 in SQL?
  • How to overcome the 5000 items list view threshold issue?
  • Practically – saw what happens when a list exceeds the 5000 items.
  • What is the limitation for normal user and administrator?

Note:

Having described the threshold limit issue and their possible workarounds to fix this in SharePoint – it's an impending open issue over a decade from Microsoft, which really Microsoft needs to fix or come up with some inbuilt alternate technique. This issue is one of the drawbacks of SharePoint which leads to many business user's dissatisfaction towards SharePoint. So Microsoft really needs to fix this issue in the long run!!!

Detailed Insight On The SharePoint 5000 List View Threshold Limit Issue (2024)
Top Articles
NBA Fantasy 2023-24 - Understanding Differences in Category vs. Points Leagues
Fantasy basketball NBA draft fallout: Alex Sarr and 11 more intriguing rookies
Dragon Age Inquisition War Table Operations and Missions Guide
Angela Babicz Leak
What to Do For Dog Upset Stomach
Team 1 Elite Club Invite
Meer klaarheid bij toewijzing rechter
Triumph Speed Twin 2025 e Speed Twin RS, nelle concessionarie da gennaio 2025 - News - Moto.it
Botanist Workbench Rs3
Polyhaven Hdri
Lenscrafters Westchester Mall
Www Thechristhospital Billpay
What’s the Difference Between Cash Flow and Profit?
Craigslist Pets Southern Md
Lenscrafters Huebner Oaks
Rainfall Map Oklahoma
The Banshees Of Inisherin Showtimes Near Regal Thornton Place
How to find cash from balance sheet?
Dr Manish Patel Mooresville Nc
Www Craigslist Com Phx
St. Petersburg, FL - Bombay. Meet Malia a Pet for Adoption - AdoptaPet.com
Rugged Gentleman Barber Shop Martinsburg Wv
Food Universe Near Me Circular
Optum Urgent Care - Nutley Photos
Mj Nails Derby Ct
Craigslistodessa
Suspiciouswetspot
Horses For Sale In Tn Craigslist
Abga Gestation Calculator
Turns As A Jetliner Crossword Clue
Datingscout Wantmatures
Eaccess Kankakee
Sun-Tattler from Hollywood, Florida
Shaman's Path Puzzle
Gas Prices In Henderson Kentucky
When His Eyes Opened Chapter 2048
Body Surface Area (BSA) Calculator
Cox Outage in Bentonville, Arkansas
Qlima© Petroleumofen Elektronischer Laserofen SRE 9046 TC mit 4,7 KW CO2 Wächter • EUR 425,95
Great Clips Virginia Center Commons
Www.craigslist.com Waco
Trivago Sf
Locate phone number
Nami Op.gg
Celsius Claims Agent
The Nikki Catsouras death - HERE the incredible photos | Horror Galore
Kjccc Sports
Phone Store On 91St Brown Deer
Market Place Tulsa Ok
Stoughton Commuter Rail Schedule
Richard Mccroskey Crime Scene Photos
What your eye doctor knows about your health
Latest Posts
Article information

Author: Trent Wehner

Last Updated:

Views: 6602

Rating: 4.6 / 5 (56 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Trent Wehner

Birthday: 1993-03-14

Address: 872 Kevin Squares, New Codyville, AK 01785-0416

Phone: +18698800304764

Job: Senior Farming Developer

Hobby: Paintball, Calligraphy, Hunting, Flying disc, Lapidary, Rafting, Inline skating

Introduction: My name is Trent Wehner, I am a talented, brainy, zealous, light, funny, gleaming, attractive person who loves writing and wants to share my knowledge and understanding with you.