Improve search performance
How can I optimize search performance for multiple columns in Filament when dealing with a table containing over 700,000 records?
21 Replies
Use a virtual column instead of two separate columns and put an index on that one
Combining the three columns into one index?
or use Scout with a real search driver
instead of mysql
Is it possible to provide a custom query for the search field without having to add it for each column?
Just for search? I don't think so.
how would you do this efficiently in normaly SQL?
because its exactly the same in filament
Is there a way to disable pagination for a resource table, as it appears to use a lot of resources?
disabling pagination would make it 100x worse?
I want to limit the response but prevent the
SELECT count(*) AS aggregate FROM
users WHERE
query from running.
I'm guessing the count(*)
is used for the table pagination navigation.switch to simple pagination?
tried but could not find a way how to switch to simple navigation on a resource table?
what did you try
https://filamentphp.com/docs/2.x/tables/getting-started#simple-pagination
do I have to write a custom table component in order to enable simple pagination on my UserResource?
no
put that code on the List page class
thanks Dan
it seems it stil performce the
count()
query
I will try another way to disable the pagination navigationit will only do the count if All is selected
disabling pagination will make it so much worse.
I dont understand how it will make it worse? I only want to fetch 20 records based on the search query and the user should not be able to paginate to the next result page.
it will kill performance when there is no filter or search
Is there a way to not perform the count query?
Filament
Fast table pagination by Dan Harrin - Tricks - Filament
Filament is a collection of tools for rapidly building beautiful TALL stack apps, designed for humans.
Thanks Dan! Really appreciate you taking the time πββοΈ