Performance of `$table->groupsOnly()`
I want to create a reporting table of db-table with ~600k rows. For this, I added
to my table. First I got memory_limit errors, after increasing it to 1GB I get timeouts > 60s.
Any ideas?
7 Replies
There is an ini setting for max_execution_time as well. Something like that. You can increase it from 60s
I know that of course, but thats not a solution waitig 4 minutes for showing a table 😉
Well, it’s going to take time to process that many rows. Unless you can optimize the query somehow I’m not sure what you can do.
Does your query take that long or do you try to render 600k rows? 🤔 In both cases this isn't really a filament issue.
Or maybe it is, if grouping happens on the PHP side. Not sure about that.
The same table without grouping takes ~1 second and 128MB memory is enough.
So it looks like filament tries to group it not with the database, but directly in php. not sure.
I couldn't figure out how to change the query
Maybe there is another solution to group the rows in the query, without using
groupsOnly()
and defaultGroup
at all?This sounds like it is grouped on DB level:
https://filamentphp.com/docs/3.x/tables/grouping#customizing-the-eloquent-query-grouping-behaviour
Maybe check Debugbar/Telescope to see the actual query
And what's the bottleneck