Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Here's the situation:

  • I have a heavily customized web application built on top of MOSS 2007
  • We're in the process of upgrading the application to SharePoint 2010
  • QA has identified that a page which used to work fine in SP2007 now throws a SPQueryThrottleException, as it queries a large list.
  • The list in question contains 52,000 items

At first sight, I thought "There are too much items being returned", so I've tried tweaking the query by setting the RowLimit and paging the results. This was to no avail: SharePoint still threw the SPQueryThrottleException.

I've looked at the query and added the fields in the <Where /> clause to the indexed fields. According to various pages this should solve my problem, but it didn't. SharePoint still throws the exception.

I've tried using the ContentIterator to process the list, passing in an SPList and an SPQuery, including several options. Alas, I still get the SPQueryThrottleException.

I'm running out of options here. The AM Team has raised the throttling limit to 100,000 rows, but I don't like this solution as it's not future proof. Further raising the limit is an option (the farm is dedicated to this web application) but undesired. An alternative is setting spList.EnableThrottling to false, to me this feels like a hack.

The columns being queried are:

  • A lookup column to a different list
  • The "Created by" (Author) column

Can anyone provide me with some pointers on how I can get this issue resolved?

share|improve this question
add comment

1 Answer

Can the lookup column have multiple values? If not, then you should index it.

When building a query, SP looks for (and only uses) the first indexed column; if there isn't one and the list is large, it throws an SPQueryThrottledException.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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