SPQuery object of SharePoint 2010 can fail or block results if we don't limit the result set.
This object is used to query list and other collection objects, and it performs well when we set the number of returned values. Quering large lists without limit will block the results of SPQuery or it can perform very slow.
Depending of the edition of SharePoint (Server or Foundation) limit the SPQuery using the following methods/parameters:
- ContentIterator.MaxItemsPerQuery (Server only, use Threshold limit for Foundation)
- OrderBy clauses