SharePoint 2010 includes a list view lookup threshold as part of its resource throttling. Columns that count as a lookup include Lookup, taxonomy (managed metadata), and User (PersonOrGroup)
The default is set to 8, and for SharePoint 365 installations, this value cannot be increased.
After implementing a more complex solution to work within this limit, i noticed that by omitting the <Query/>
element in my SOAP request, the threshold exception is not thrown
For instance the following request would succeed, returning the first 500 rows of data including all values for the lookup threshold counting columns:
"<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetListItemChangesSinceToken xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>{9F2DD6AD-85A2-4E0B-8EB5-8FF2796A4659}</listName>
<viewFields>
<ViewFields Properties="True" xmlns="" />
</viewFields>
<rowLimit>500</rowLimit>
<queryOptions>
<QueryOptions xmlns="">
<IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns>
</QueryOptions>
</queryOptions>
</GetListItemChangesSinceToken>
</soap:Body>
</soap:Envelope>"
While the following request fails with the soap server exception: "The query cannot be completed because the number of lookup columns it contains exceeds the lookup column threshold enforced by the administrator."
"<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetListItemChangesSinceToken xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<listName>{9F2DD6AD-85A2-4E0B-8EB5-8FF2796A4659}</listName>
<query>
<Query xmlns=""></Query>
</query>
<viewFields>
<ViewFields Properties="True" xmlns="" />
</viewFields>
<rowLimit>500</rowLimit>
<queryOptions>
<QueryOptions xmlns="">
<IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns>
</QueryOptions>
</queryOptions>
</GetListItemChangesSinceToken>
</soap:Body>
</soap:Envelope>"
Question: Is this a bug in SharePoint, or is it valid to expect a table dump when no query is supplied?
If returning all columns still requires lookups for the threshold counting columns, this ought to be a bug.