It's lazy, so you don't have to load all of the keys, but you will probably load all of the keys that precede your offset, so it starts off pretty good and gets worse with higher pages. You can still rely to an extent on the law of averages. It should relatively rare that people look beyond the first few pages of a very large result set.
Chris On Mon, Apr 11, 2016 at 8:22 AM, Joe Steeve <[email protected]> wrote: > I am trying to understand the best way to show a paginated view of a > repoze Folder. > > Currently I am using an "offset & length" style approach. Given a > page_size, I compute the number of pages. But to access a particular > page, I am slicing through the keys(), and using the sliced keys to > access the data. From a high-level look of the implementation, looks > like the entire "keys()" will have to be loaded in order for it to > slice. > > I am uncomfortable with the "entire keys() loading" part. Is there a > better way? > > -- > Joe Steeve > HiPro IT Solutions Private Limited > http://hipro.co.in/ > > -- > You received this message because you are subscribed to the Google Groups > "pylons-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/pylons-discuss. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/pylons-discuss. For more options, visit https://groups.google.com/d/optout.
