I use Brett Slatkin's technique: in the model I page over, I have a
string property called "order". It's a composite string and it's
guarantied to be unique.

When querying for entities, I ORDER BY this property. If I want to
have 20 entities per page, I fetch 21 entities, show 20 of them and
use 21st's "order" in the "Next >>" link: /mypage?next=order

The "next" parameter is used in the query to skip entities: "WHERE
order >= :next"

This allows to page as far as user wants without much burden on the
datastore. The only downside is that it's not possible to page back,
but alas, that's what the browser's "Back" button is for!

Alex
--
www.muspy.com

On Nov 20, 3:38 am, "Abel Rodriguez" <[EMAIL PROTECTED]> wrote:
> I am currently doing a detailed study on how to optimize my
> application to be scalable.
>
> I have thoroughly studied the lectures delivered by the engineers at
> google, and my opinion: fantastic
>
> In this case, my question comes from the presentation
>
> Buildding Scalable Web Applications with Google App Engine whose
> rapporteur was Brett Slatkin
>
> In it, in the section "Building a Blog: Paging ", using the attribute
> index, get to paginate infinite elements, using the index as a guide
> for the next entry
>
> Now, suppose you delete an entity, the attribute index would not be
> consecutive. taking into account that, any idea howto  implement
> paging that supports not only next and previous, but also, goto "n"
> page number.?
>
> thanks in advance,
>
> Abel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to