[Pulp-dev] Pagination Requirements and Defaults?

Grant Gainey ggainey at redhat.com
Tue Aug 20 17:40:00 UTC 2019


FWIW, Postgres directly supports limit/offset as part of the SELECT syntax
(make sure your selects always use ORDER BY, or things get...odd)

Strictly from a performance standpoint, the decision for which form you
should use, down at the db level, can be complicated. See, for example

https://slack.engineering/evolving-api-pagination-at-slack-1c1f644f8e12
https://blog.couchbase.com/offset-keyset-pagination-n1ql-query-couchbase/

G


On Tue, Aug 20, 2019 at 1:07 PM David Davis <daviddavis at redhat.com> wrote:

> #3801 only describes the move from CursorPagination to
> PageNumberPagination. I don't think we considered
> using LimitOffsetPagination.
>
> David
>
>
> On Tue, Aug 20, 2019 at 1:01 PM Dennis Kliban <dkliban at redhat.com> wrote:
>
>> On Tue, Aug 20, 2019 at 12:17 PM Brian Bouterse <bmbouter at redhat.com>
>> wrote:
>>
>>> Recently with pulp_ansible, users were interested in using pagination
>>> with LimitOffsetPagination [0]. Pulp currently defaults to
>>> PageNumberPagination. I looked at our current DRF defaults, and I noticed
>>> two things.
>>>
>>> 1. We default to the not-as-common PageNumberPagination based on
>>> examples in the drf docs.
>>> 2. We customize it here [1] in various ways.
>>>
>>> Can someone help me remember why these pagination style choices were
>>> made or where the requirements came from?
>>>
>>
>> I believe the motivation is described here:
>> https://pulp.plan.io/issues/3801
>>
>>
>>> Would our bindings work with a LimitOffsetPagination style?
>>>
>>
>> Yes, the bindings will work with anything that uses query parameters for
>> pagination.
>>
>>
>>> What use cases drove the use and customization in this area?
>>>
>>> Also, @katello how would a pagination style change (like switching to
>>> LimitOffsetPagination) affect you?
>>>
>>> Thanks for any info you can provide. Maybe what we have right now is
>>> just what we need, but I'm not sure.
>>>
>>> -Brian
>>>
>>> [0]:
>>> https://www.django-rest-framework.org/api-guide/pagination/#setting-the-pagination-style
>>> [1]:
>>> https://github.com/pulp/pulpcore/blob/master/pulpcore/app/pagination.py
>>> _______________________________________________
>>> Pulp-dev mailing list
>>> Pulp-dev at redhat.com
>>> https://www.redhat.com/mailman/listinfo/pulp-dev
>>>
>> _______________________________________________
>> Pulp-dev mailing list
>> Pulp-dev at redhat.com
>> https://www.redhat.com/mailman/listinfo/pulp-dev
>>
> _______________________________________________
> Pulp-dev mailing list
> Pulp-dev at redhat.com
> https://www.redhat.com/mailman/listinfo/pulp-dev
>


-- 
Grant Gainey
Principal Software Engineer, Red Hat System Management Engineering
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pulp-dev/attachments/20190820/9bbf8102/attachment.htm>


More information about the Pulp-dev mailing list