11

I have a document library in SharePoint Foundation 2010 which contains over 10,000 items, arranged in folders such that no folder contains more than 2000 items. I've created a public view called 'Documents checked out' whose criteria is very simple:

  • Filter: 'Checked out to' is not equal to ''
  • Folders: 'Show all items without folders'

Under WSS 3.0, this view would achieve the desired behaviour. For this library, there are never more than 100 documents checked out at any given time. Under SharePoint 2010, I get the message 'This view cannot be displayed because it exceeds the list view threshold (5000 items) enforced by the administrator.'

Manually increasing the threshold to 20,000 items allows the view to display, showing less than 20 items in this particular case. Re-enforcing the 5000 limit causes the view to fail to display again.

I thought views were supposed to be a legitimate way of avoiding the list view threshold? How can I create the view as intended?

5
  • Edit: Some theories as to why this may not be working: 'Not equal to' is not a SARG, so it may not get optimised properly? Recursing through all folders is preventing the view from being optimised? Commented Oct 27, 2011 at 16:35
  • Did you end up figuring this out? I have the same problem on SharePoint Foundation 2010, was hoping someone would be able to clarify.
    – user9749
    Commented Jul 30, 2012 at 17:10
  • I raised the throttling threshold from 5000 to 20000, but I don't regard that as an acceptable solution. Commented Jul 31, 2012 at 0:33
  • Are there lookup columns in the library? Those count against the throttle limits too. Commented Aug 3, 2012 at 18:12
  • @PirateEric No, there are none; the library matches the default settings. Commented Aug 5, 2012 at 8:31

4 Answers 4

4
+50

You have the option to set the list view throttling really high, however there is another option to disable the throttling altogether. We've actually disabled the list view throttling on two particular lists on our farm.

Here is a powershell script, to disable list view throttling:

$web = Get-SPWeb http://url/to/web/with/list
$list = $web.Lists[“BIG_LIST_NAME”]
$list.EnableThrottling = $false

Source: http://blogs.msdn.com/b/mimorr/archive/2012/08/28/disable-sharepoint-2010-list-throttling-at-the-list-level.aspx

10
  • It's helpful to know that the throttling can be switched off entirely, but it's an undesirable solution. I am more interested as to why i'm running into the problem in the first place (no folder contains more than 2000 items), and why indexing the view doesn't solve the problem. Commented Jul 31, 2012 at 0:38
  • Check out the following link, it's by microsoft, explaining using indexing for large list views, and other techniques for large lists... office.microsoft.com/en-us/sharepoint-server-help/… Commented Jul 31, 2012 at 12:40
  • Unfortunately this still doesn't explain why, even after creating an index on the Checked Out To field (and filtering using a not-equal-to condition), I continue to receive the list view threshold error. Commented Aug 1, 2012 at 1:00
  • What's the current count you are receiving in the view? and what's the threshold set to currently? Commented Aug 1, 2012 at 18:22
  • 1
    So, in what way did this answer help you? Did you end up excluding the list itself from throttling? @QuinnJohns please dont just link to external sites. Please use a few lines to describe how the code on the site helps solving the Q and then link. Commented Aug 6, 2012 at 6:48
5

Yes, however, your threshold also applies to queries, and creating a view that must query more than 5000 items will again hit the threshold. You can bypass this by using indexed columns. Then run your query on the indexed column, because you are querying the index. To set the "Checked out To" column as an index, go to the library settings and below the list of columns, click on Indexed Columns, create a new index and set it to that column. Now when you run your view, make sure that you have the query from the column that shows as being indexed and you should be able to make your view work within the threshold.

2
  • 3
    I deleted the existing view, created an index on 'checked out to' and recreated the view. 'Checked out to' was displaying as indexed, as expected. After saving the view, I got the same error message when I tried to open it. Could this have anything to do with my filter being based on a 'not equal to' condition, or the fact that this is SharePoint Foundation? Commented Oct 26, 2011 at 16:08
  • sometimes a trick works in this situation add an another clause to your view with id>1 . I can't explain though why it works it helped me on more than one occasion when working with large list. Commented Oct 23, 2018 at 8:29
5

Yikes!!!! I cannot believe turning off the threshold is an accepted solution here. There is a reason why a threshold exists.

I had a similiar issue in a SPF environment. First I set Checked Out To as indexed. Here are the view filters that were entered to get the desired results:

  1. Checked Out To is not equal to [leave the textbox empty]
  2. ID is greater than 0

I would not recommend turning off thresholds indefintely unless you have a supercomputer running SharePoint and only two users are accessing the site. Even then... yikes!!!

4
  • 4
    I was uncomfortable disabling throttling completely, so I decided to change my strategy; instead of using a view, I now use a CAML query executed using the object model. The query runs with the SPQueryThrottleOption.Override setting, thus bypassing the list view threshold. I haven't tried your solution, but the only difference between it and others i've tried is that you're adding the condition 'ID>0' - i'm not sure why this would fix the problem? Commented Mar 21, 2013 at 2:03
  • Another shout out for ID > 0, had to do this in a "all items without folders" view where I was also filtering via querystring... FilterName=column&FilterValue=somevalue*
    – James Love
    Commented Mar 9, 2016 at 11:37
  • @BradleySmith I don't understand, where is this caml query running? Is this something you did to a view in designer?
    – Batman
    Commented Mar 17, 2016 at 3:56
  • @Batman In this case, i'm running the CAML query inside a custom WCF service, passing an instance of the SPQuery class to the SPDocumentLibrary.GetItems method. Commented Mar 17, 2016 at 4:06
3

I know this question was asked a long time ago, but i thought I'd share an answer anyway in case someone is still experiencing this problem and can't figure out why the problem occurs.

Yes, indexing a column and filtering on that column should work. However, it will not work when the filter is written like [Column] equal to (Empty) for the simple reason that an empty value can't be Indexed in the database. This causes the query to have to iterate over all the data anyway in order to find the ones that have empty values for the desired column.

I.E the problem is primarily a limitation on the database level.

Mentioned here: https://stackoverflow.com/questions/9175591/index-for-nullable-column and here: https://stackoverflow.com/questions/20687213/does-sql-server-index-null-values-in-a-non-clustered-non-unique-index

The only way around this that I have found is to not have views that are entirely filtered on empty values. If possible I use a non-empty column for the first filter field in order to reduce the result and then the next filter-field can be filtered on Empty because then the query only iterates the already filtered out result that should be less than 5000.

1
  • Adding to this idea, you could implement a simple workflow in SharePoint Designer to set a column value each time an item is modified (e.g. IsCheckedOut => Yes) that you would then index and use for filtering the view. Commented Jan 31, 2019 at 15:26

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.