optimise the filterpredicate to support angular mat table with data source more than 80k records

Viewed 94

I created an angular mat table with 100 records in its data source, I applied a filter predicate function across all the data to support complex search queries, basically search by columns using "AND" as default clause data table with records search queries supported include:

  • levi (any simple string that search across all the records , along all the columns)
  • color = gray (column based search , that search across mentioned column name )
  • color = gray AND name = jasper (search a specific entries by combining different column name using AND")

The filter Predicate works well when records are less(2k), but it takes time n makes browser hang when records are gradually increasing(20k-80k).I would like to know if the logic I implemented in filter Predicate can be optimized to support huge number of records or alternatively not cause browser to hang up.

And Here is the link to stackblitz

0 Answers
Related