New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow loading when data more than 1000 #931
Comments
I am facing the same issue, with more than 1 lac records in database. But my query and scenario is bit complex. In my table I am showing data from more than 3 tables. And I am edit column values before rendering the data into table. This is the code for my view
In my view i am using custom blade file for loading Datatble JavaScript
In my JavaScript blade file I am calling a route for server side processing, which generates query builder for my table with joins and then calls a function which render table.
Function to build querybuilder
Finally the function which renders data in table
This works fast for first 500 records but gets slow after data increases. @ssuhat Sorry for adding this long comment, but your issue seems same like mine and I don't want to raise a duplicate issue for it. |
Not really sure on this but I'm using Digital Ocean too on my demo app and response is a bit fast I think. There must something else happening on your server? Maybe try checking your logs and your server resources? |
@yajra I'm using Laravel Forge to handle my server. So I think it's not server problem. |
@yajra Do you have any suggestion for me? |
Hi, i have the same problem. im doing select of 8 fields with 3 join in a table of 25.000 records and this is slowly. (8 second per 25 records per page) some tips for speed up the thing? Thanks |
Maybe you could enable the slow queries log and see if there is any recommendation? |
@ssuhat and @mariani10, it's just a suggestion(ignore if you've already done it). Check execution time of your queries and try to optimize them. In my case the query I wrote was slow so it made datatable loading slow. After optimizing the query it's working faster now. |
Adding indexes can be the key to better performances |
Replace: |
Yes, indexing and optimizing the query is the solution for slow performance. And of course avoid using collection. Thanks! |
Just to add to this discussion, after you've made sure your passing the query to Datatables (and not the Collection - see comments above) - yes, you can add indexes, but you actually want to create composite indexes of the columns you're selecting. e.g. you want a composite index on columns foo, bar, created_at if you're query looks like this |
There is no way to get fast. I am using own laravel pagination 1000 records and after applying datatable and removed jquery datatable bottom pagination. That's fine to me |
This is the best solution. |
Summary of problem or feature request
I used this plugin for very long time. but after few days it slow me down (really slow). I try to query > 1K data. It keep loading for at least 5 seconds or more to show the data. It happen when change pagination too.
Code snippet of problem
System details
Digital Ocean $10.
The text was updated successfully, but these errors were encountered: