have you checked if your console and network tabs is throwing any errors or something unusual? and if you have debugbar, have you checked if there are any duplicate queries? would be nice if you could share the code where you are returning the records.
A query with pagination takes much longer than using get()
Hello,
I was trying to see why a page takes over a minute to load.
At first, I thought the query is too complex and unoptimized, so I directly put the raw query (given by ->toSql()) into the Microsoft SQL Server Management Studio.
But to my surprise the query executed instantly (00:00:00). But in Laravel it takes over 20 seconds
The difference is that in Laravel I use $query->paginate(), and I have 3 paginators in this page.
However if I change that to $query->get() it goes down to 2-3 seconds (The extra 2-3 seconds are probably because the DB is on a different server)
What could cause this issue? Can I fix that?
Thanks
Please or to participate in this conversation.