Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Laravel pagination or simple pagination

I understand that I should use simple pagination if i have a large dataset but somebody could please tell me if there is a way to determinate when is large enough to apply simple pagination

For example on the near future I'm gonna have to handle a table with 40K of records, I'm gonna use simple pagination but... should I use it or just I'm overreacting

Thanks in advance

like image 383
Mirdrack Avatar asked Sep 11 '25 22:09

Mirdrack


1 Answers

It's hard to answer, you should do some testing on both methods before you figure out if you need to do simple pagination.

The difference is pagination runs an extra query which selects count(*) using the same query without the limit so that it knows how many pages to show and how to generate your links. Since simple paginate does not use the numbered links, just next and previous, it doesn't need to run that additional query.

Even 40k records is a fairly small data set and you should be safe using paginate unless you specifically don't want or need those extra links it provides, in which case, use simple paginate.

like image 67
user1669496 Avatar answered Sep 13 '25 11:09

user1669496