@alexgodbehere79 creating indexes on filter fields will improve your performance.
Laravel Performance question
Hello. I have a laravel performance question.
Imagine that I have 5M records in one table and I am fetching them by pagination. Below is my performance result-
- Fetch 5M records by paginate 100, Memory Uses
4MB, Time4.19s. - Filter by 6 types (mostly max and min records fiterization) from 5M records and found around 2M by 100 paginate Memory Uses
4MB, Time6.15s.
Now if I ask you as expert that, is my performance is standard by fetching time, and memory? Or you guys can feel that it can make better also?
Thanks in advanced for your answer.
Hey, no doubt that 5M is a big amount of data. Ofcourse, it's not a wise idea to dump your data at a time. Now the question is how do you want to slice your data?
Recently I was working with such kinds of things. I tried few options like paginate() chunk() cursor() and simplePaginate().
I found the best solution for me is the simplePaginate because of it take less memory and time to load probably because of it uses lazyload. I was working with around 2M data, where I somehow able to load them by simplePaginate in ~6s. The only drawback is you cannot count the total of the matched records directly on it.
Again, it's always depends on the indexing, caching and the hardware that others suggested already.
Please or to participate in this conversation.