I am using LiteDB to store approx.1 million records. When i retrieve records from LiteDb after filtering and convert .ToList() from IQueryable, it is very slow even the result of the query is just one record. I am really stuck on this.
I found that the problem with the convert .ToList().
I was reading some about similar kind of problem (i.e .ToList()) already faced. But not getting any correct solution.
my sample code:
IQueryable<student> activeFilterResult = liteDatabase
.GetCollection<student>(studentcollection)
.Find(Query.All())
.AsQueryable<student>();
...............
activeFilterResult
.OrderBy(studentrecord => studentrecord.Id)
.Select(studentrecord => studentrecord.Id)
.Distinct()
.ToList();