I have a SPSiteDataQuery that returns a result from 6 lists. The lists together contain like 200000 items. The result for my query is like 100 items (only today's items). But no matter what I do, I keep getting a Throttle Exception. I already set the rowlimit to 2500 and override the query throttle mode. This is my code.
Builder camlBuilder = new Builder(U2U.SharePoint.CAML.Enumerations.CamlTypes.Query);
camlBuilder.AddWhereField("Created", createdFrom.ToString(), "DateTime", "Geq", out addCombinerNode);
camlBuilder.AddWhereField("Created", createdTill.ToString(), "DateTime", "Leq", out addCombinerNode);
camlBuilder.AddViewField("ID");
camlBuilder.AddViewField("LinkFilename");
camlBuilder.AddViewField("FileDirRef");
camlBuilder.AddViewField("ContentType");
camlBuilder.AddViewField("Created");
camlBuilder.AddViewField("Modified");
SPSiteDataQuery apQuery = new SPSiteDataQuery();
apQuery.Lists = "<Lists BaseType='1' />";
apQuery.Webs = "<Webs Scope='Recursive' />";
apQuery.ViewFields = camlBuilder.ViewFieldsNode.InnerXml;
apQuery.Query = camlBuilder.WhereNode.OuterXml;
apQuery.RowLimit = 2500;
apQuery.QueryThrottleMode = SPQueryThrottleOption.Override;
// execute the query on the site
DataTable dt = new DataTable();
dt = web.GetSiteData(apQuery);
I don't know why I'm still getting this Throttle Exception and how to prevent this. Can someone explain this behaviour?