Performance of `$table->groupsOnly()`

I want to create a reporting table of db-table with ~600k rows. For this, I added
->defaultGroup("ad_advertorial_id")
->groupsOnly()
->defaultGroup("ad_advertorial_id")
->groupsOnly()
to my table. First I got memory_limit errors, after increasing it to 1GB I get timeouts > 60s. Any ideas?
7 Replies
awcodes
awcodes16mo ago
There is an ini setting for max_execution_time as well. Something like that. You can increase it from 60s
bernhard
bernhardOP16mo ago
I know that of course, but thats not a solution waitig 4 minutes for showing a table 😉
awcodes
awcodes16mo ago
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.
Dennis Koch
Dennis Koch16mo ago
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.
bernhard
bernhardOP16mo ago
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?
Dennis Koch
Dennis Koch16mo ago
Maybe check Debugbar/Telescope to see the actual query And what's the bottleneck
Want results from more Discord servers?
Add your server