Skip to content

Disable count to improve performance on large dataset #172

Answered by alirezanet
asafhbinov asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @asafhbinov,
if you check the GridifyQueryable method, it essentially applies filtering, retrieves the count, and then ordering and paging sequentially.

   public static QueryablePaging<T> GridifyQueryable<T>(this IQueryable<T> query, IGridifyQuery? gridifyQuery, IGridifyMapper<T>? mapper = null)
   {
      query = query.ApplyFiltering(gridifyQuery, mapper);
      var count = query.Count();
      query = query.ApplyOrdering(gridifyQuery, mapper);
      query = query.ApplyPaging(gridifyQuery);
      return new QueryablePaging<T>(count, query);
   }

You have complete control over each operation within Gridify. You can create your own extension to bypass the counting process, or you can o…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alirezanet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants