0
votes

I found the following in the FAQ after sorting out a bug.

It’s possible that you are trying to paginate a static Array instead of performing a paginated query in the database. For instance, chaining a paginate call after an Active Record find or all methods is wrong:

The above line will return the desired result but defeats the purpose of pagination. Here, the find query will first load all the records from the database, which is dangerous and should be avoided.

My question is why is it dangerous to paginate a find?

1

1 Answers

2
votes

Pagination is meant to prevent unnecessary db load: you only want some elements from the db, so you only load them.

Using find you load everything then you kind of sort.

Dangerous == Heavy db load and thus potential crash.