Noreh AD
Noreh AD
FFilament
Created by Noreh AD on 11/17/2023 in #❓┊help
Listing large table is slow
I'm somewhat new to Laravel, and completely new to filament. Since things seem to be quicker/practical in filament, I just hoped there was a way to do this quicker, like defining a method on the resource to return the count, or chain/call some method on the $table, idk. Seeing that this (working with large tables) isn't handled by default, makes me think that this is not a standard issue? I'm also trying to minimize the things I have to learn/deal with for standard things, so that's me being lazy, I guess.
34 replies
FFilament
Created by Noreh AD on 11/17/2023 in #❓┊help
Listing large table is slow
There should be a way to provice the count manually for pagination
34 replies
FFilament
Created by Noreh AD on 11/17/2023 in #❓┊help
Listing large table is slow
The point is count(*) is slow on large tables. I can't use this on 50m table
34 replies
FFilament
Created by Noreh AD on 11/17/2023 in #❓┊help
Listing large table is slow
I can also cache it
34 replies
FFilament
Created by Noreh AD on 11/17/2023 in #❓┊help
Listing large table is slow
show table status like 'my_table'; SELECT TABLE_ROWS FROM information_schema.tables WHERE table_schema = 'my_db' AND table_name = 'my_table';
34 replies
FFilament
Created by Noreh AD on 11/17/2023 in #❓┊help
Listing large table is slow
However, if it's possible to provide count manually (for pagination) in eloquent (idk, I'll give it a go), why filament doesn't have an option for this? One can easily define a function (e.g. getCount()) in the resource class.
34 replies
FFilament
Created by Noreh AD on 11/17/2023 in #❓┊help
Listing large table is slow
I suppose I'll try providing custom count value in plain laravel and try to get it work there. Maybe then do the same in filament.
34 replies
FFilament
Created by Noreh AD on 11/17/2023 in #❓┊help
Listing large table is slow
I just thought that filament have a quick solution for this
34 replies
FFilament
Created by Noreh AD on 11/17/2023 in #❓┊help
Listing large table is slow
I know. Count(*) is slow. However, it's not necessary to query the count. The count can be retrived by other faster methods than count(*)
34 replies
FFilament
Created by Noreh AD on 11/17/2023 in #❓┊help
Listing large table is slow
This is a count(*) issue. I should be able to provide this count manually.
34 replies
FFilament
Created by Noreh AD on 11/17/2023 in #❓┊help
Listing large table is slow
The debugbar was later installed to inspect the issue. Icons are already cached. Table is indexed.
34 replies
FFilament
Created by Noreh AD on 11/17/2023 in #❓┊help
Listing large table is slow
If I have to fallback for such a simple requirement, why use filament at all? I'm currently experimenting with filament, so I'm not that familiar with it, but so far, things don't look good.
34 replies
FFilament
Created by Noreh AD on 11/17/2023 in #❓┊help
Listing large table is slow
Also, it seems viewing the record (in modal) also triggers the count(*) again. So I'll have to wait for that too.
34 replies
FFilament
Created by Noreh AD on 11/17/2023 in #❓┊help
Listing large table is slow
I see the following logs in Queries of the debugbar: select count(*) as aggregate from my_table 64.45s select * from my_table order by my_table.id asc limit 10 offset 0 830μs Waiting a min to get the row count is unacceptable.
34 replies