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
Data loading is very slow for big number of rows. #1053
Comments
You might be using collection instead of query? Can you paste your server-side code? Thanks! |
I use repository pattern and in my LanguageRepository.php I have: |
You need to remove get to use the query builder. return $this->languages->select('languages.*'); |
Okey. Now looks better. I will test it again and will write my results.
|
Set action as not searchable/orderable since it's added column. |
Thank you very much! @yajra |
My testing results: First query: Second query: Thanks @yajra once again for help. |
Glad I was able to help! Thanks! |
I am suffering from the problem. Slow rendering. My server side query.
help me. Should I write my own script to paginate? what should I do? |
I got this one too, may be the datatable request not chaining the pagination param to the query? |
@pnghai how I can check it? |
@hsali I'm sorry. False alarm. Turned out that my logic involved a remote image fetching, that links to a dead-end server and force each record fetch wrong 404 connection, that take up number of record * 60 (seconds before timeout). I suspended that logic and things work very well now. Thank you very much |
Were you able to resolve this? If yes, how? |
For anyone who gets slow loading, you might have some sort of loop in your controller function that loops the fetched records in some way. |
Hi, @yajra. I am facing a problem with loading speed. count_row_table taking a big time in the query section. Please check the below results. It's about 7000 data rows and it's taking more than 7s only the count query. And I code like this.
|
Summary of problem or feature request
I tried to implement Datatable with Laravel but I have problem when my table has big number of rows because Datatable get ALL in one request and then pagination is on JS side. Can I use Laravel pagination or can I return paginated rows with
paginate()
method from Eloquent on ajax method ? Because this is big problem for my project. Data loading is very slow. When I search some word processing is also very slow and after some operation likesort
,search
etc. Page freeze and nothing happen.I hope that someone has same problem like this.
Code snippet of problem
System details
The text was updated successfully, but these errors were encountered: