In general, 700 thousand lines (xxx.xxx.xxx.xxx - ip) in the database A text file comes from ~ 400 thousand actual ones, you need to go through and save 400 thousand actual ones in the database, the remaining 300 to mark that they are not relevant. Everything would be fine, everything works, but this sort of search takes 11 minutes on a 4 GHz stone. I do this:
//Тут сортирую по ip, строки из БД 700 тысяч ListCurrentBD.Sort((x, y) => x["ipWorld"].CompareTo(y["ipWorld"])); for(int i=0; i < ipList.Count; i++) { //находим индекс по компарер ipWorld int indS = ListCurrentBD.BinarySearch(ipList[i], new CompareripWorld()); if (!(indS<0)) { //Заносим данные, позже по этому листу обновим актуальные ip ListUpdateBD.Add(ipList[i]); //добавляем идентификатор по которому будем обновлять актуальность ListUpdateBD[ListUpdateBD.Count-1]["id"] = ListCurrentBD[indS]["id"]; } } The beginning of the question How to create an associative array with sorting, quick search and deletion of elements