locked
Linq Where clause timeout RRS feed

  • Question

  • User417741264 posted

    I have two lists having large number of records for e.g. 300k in each list

    List<string> list1,List<string> list2

    i am trying to compare two lists and find the items which are in list1 but not in list2.

    dbStudentList.Where(list2 => !actualStudentList.Any(list1 => list2.Name.Contains(list1))).Select(i => new { Row = i.RowNumber, Name= i.Name }).ToList();

    The above query working fine if the lists having <100K only. is there any problem or limitation with above query? 

    Monday, July 17, 2017 1:37 PM

All replies

  • User-1716951449 posted

    - create the proper indexes

    have u ever look at the sql generated by linq?

    when u working with large volume of data, with performance challenge, i highly suggest avoid using linq

    use tmp table, use stored procedure

    Tuesday, July 18, 2017 12:54 AM