I have a list that currently has around 18,000 items. will my rest query continue to work once it breaks the 20,000 mark?

I found this similar question for when the limit was 5k: Approaches for using REST API on list with more than 5K items

it has a comment on the answer : For example, you may have a list of 5k+ items and caml filter query on a none-indexed column. This filter query returns only one single item from the 5k+ list. And you will be throttled by SharePoint and will get a throttle exception. Correct statement - if your operation involves more than 5k items you will be throttled

can I infer from that if all columns that the REST query uses have indexed it will be OK? If any of the columns do not have indexes it will not work?

2 Answers 2



To give you an answer if it works or not need to check the query itself. How man actual items SharePoint needs to retrieve to construct your result.

If you filter on one of the fields that is indexed you should be fine, but if you add another column to the mix, your query might break. This is caused by the fact that there is no optimal way to combine values from 2 different indexes at runtime. You have first_name indexed and then want to retrieve all "Johns" and sort them by the last name? This could cause issues since SharePoint might go over the 5000 item limit in order to sort all Johns correctly. While it would be fine without the additional sorting itself.

The statement will be terminated by SharePoint once it fetches the 5001st item from SQL itself while building the result.

And this can be caused by any of the following actions:

  • filtering (by more than one field)
  • sorting
  • grouping
  • linked fields (Users, Workflow status, MMS fields, other linked lists)

The last option will trigger a different limit though, but its the same general exception. The last issue can be solved by reducing the total number of linked fields in the query


Use SharePoint search REST API https://docs.microsoft.com/en-us/sharepoint/dev/general-development/sharepoint-search-rest-api-overview and consider rewrite your script. Use CAML to tryif CAML brings 0 then switch to Search API. Why should you do This? because if you relly only in serach you are going to lost more freshier items, if you relly only in caml you lost some items buried in 20k barrier

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.