I have one custom list which contains appox 10500000 data and it was working fine. but after that it throws timeout error.
so what we did is we trim 20 Lakhs data from that list so list has now 8000000 items. but still it throws timeout error previously it was working with 10000000 data also.
List threshold value is 11000000. Current items in list is 8000000.
we are trying to retrieving data using C# code. Below is the code
SPList list = web.Lists[listName];
SPQuery query = new SPQuery();
query.Query = "<Where><And><In><FieldRef Name='Site' LookupId='TRUE' /><Values><Value Type='Integer'>95</Value><Value Type='Integer'>178</Value><Value Type='Integer'>129</Value><Value Type='Integer'>208</Value><Value Type='Integer'>72</Value><Value Type='Integer'>75</Value><Value Type='Integer'>131</Value><Value Type='Integer'>39</Value><Value Type='Integer'>96</Value><Value Type='Integer'>479</Value><Value Type='Integer'>86</Value><Value Type='Integer'>67</Value><Value Type='Integer'>125</Value><Value Type='Integer'>23</Value><Value Type='Integer'>165</Value><Value Type='Integer'>472</Value><Value Type='Integer'>132</Value><Value Type='Integer'>118</Value><Value Type='Integer'>70</Value><Value Type='Integer'>79</Value><Value Type='Integer'>108</Value><Value Type='Integer'>40</Value><Value Type='Integer'>666</Value><Value Type='Integer'>158</Value><Value Type='Integer'>94</Value><Value Type='Integer'>227</Value><Value Type='Integer'>101</Value><Value Type='Integer'>474</Value><Value Type='Integer'>42</Value><Value Type='Integer'>63</Value><Value Type='Integer'>102</Value></Values></In><Gt><FieldRef Name='Resulted_x0020_Date_x0020_Time' /><Value Type='DateTime'>2017-06-17T19:00:00Z</Value></Gt></And></Where><OrderBy><FieldRef Name='Resulted_x0020_Date_x0020_Time' Ascending='False' /></OrderBy>";
query.ViewFields = "<FieldRef Name=\"ID\"/><FieldRef Name=\"FirstName\"/><FieldRef Name=\"Last_x0020_Name\"/><FieldRef Name=\"Birthday\"/><FieldRef Name=\"Gender\"/><FieldRef Name=\"Resulted Date Time\"/>";
query.RowLimit = 50;
SPListItemCollection myItems = list.GetItems(query);
int count = myItems.Count;