Way to Optimize Navigation badges counts

I have a query that get the count of a model for each resource in Filament. It's taking to much time now since there is so much data. is there a good way to get it without using the cache?
No description
Solution:
Ensure you've got your database indexes optimised, and count really shouldn't be taking any time at all. You could use a persistent view within your database structure to store your counts...but really modern databases don't need these workarounds....
Jump to solution
2 Replies
Solution
Matthew
Matthew3mo ago
Ensure you've got your database indexes optimised, and count really shouldn't be taking any time at all. You could use a persistent view within your database structure to store your counts...but really modern databases don't need these workarounds.
Hasan Tahseen
Hasan TahseenOP3mo ago
yeah the indexes optimization make it faster. 2.3s to 800ms thanks

Did you find this page helpful?