KnpLabs / KnpPaginatorBundle

SEO friendly Symfony paginator to sort and paginate
http://knplabs.com/en/blog/knp-paginator-reborn
MIT License
1.76k stars 344 forks source link

Cursor pagination #808

Open Huluti opened 1 month ago

Huluti commented 1 month ago

Feature Request

Q A
New Feature yes
RFC no
BC Break no

Summary

For performance reasons, for huge datasets, it could be really good to have a solution to paginate using cursor strategy instead of LIMIT/OFFSET.

Cursor based pagination is more scalable compared to offset based pagination. As the dataset grows, the cursor based pagination method can continue to retrieve data efficiently, while offset based pagination becomes less efficient as the dataset grows larger.

Of course, it has some some disadvantages, such as not being able to choose a specific page.

Some resources:

Maybe it could be added as a new option?

garak commented 1 month ago

If I understand, the cursor pagination doesn't include a page. It seems this could hardly fit our current implementation, but let me know if you think it could be feasible anyway.