Inefficient table
I have a resource that uses a table, which is quite slow to load, even with 10 rows. I use standard everything, the queries are efficient, but it uses a lot of views, and I have a function that modifies one of the columns in which I have tried to put a Log::info and it registers that it is called 70 times in those 10 rows. Why is that?
I've tried leaving only the id field, but it still loads 137 views, and it still takes a while to load.
How can I optimize it?
Thanks
6 Replies
turn off the view collection in the debugbar config. that is slowing it down. also,
artisan icons:cache
I did both, but the problem persist (I see the same behaviour using Telescope)
I doubt the views are the problem. It sound's like you have an n+1 problem somewhere. Or the DB isn't optimized.
Maybe n+1 problem, db queries are finished in no time. I'll continue debugging, thanks
I had a similar issue with one of the very simple pages, DB was doing nothing yet the page was very slow to render. Issue was i had some selects with relationships that were not needed at all as the table itself had those records. Removed the selects and used TextInput with data from table and page is now blazing fast.
Great, thank you, I'm going to check all the selects and the loading data