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?

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?
–
Bradley SmithOct 27 '11 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.
–
user9749Jul 30 '12 at 17:10

I raised the throttling threshold from 5000 to 20000, but I don't regard that as an acceptable solution.
–
Bradley SmithJul 31 '12 at 0:33

Are there lookup columns in the library? Those count against the throttle limits too.
–
PirateEric♦Aug 3 '12 at 18:12

3 Answers
3

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.

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.
–
Bradley SmithJul 31 '12 at 0:38

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.
–
Bradley SmithAug 1 '12 at 1:00

What's the current count you are receiving in the view? and what's the threshold set to currently?
–
Quinn JohnsAug 1 '12 at 18:22

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.

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?
–
Bradley SmithOct 26 '11 at 16:08

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?
–
Bradley SmithMar 21 '13 at 2:03