Code

Changes between Version 6 and Version 7 of NoSqlSupport


Ignore:
Timestamp:
02/03/11 01:25:46 (3 years ago)
Author:
wkornewald
Comment:

pagination and count() affect admin UI

Legend:

Unmodified
Added
Removed
Modified
  • NoSqlSupport

    v6 v7  
    154154On some DBs it's inefficient to request entities using a large offset (`queryset[5000:...]`). E.g., App Engine's datastore doesn't actually support offsets. When you use an offset the datastore always starts from offset 0 and throws away all results you didn't request (which means you can't ever query e.g. for the 10000th result). Instead of integer offsets App Engine and SimpleDB provide some kind of "bookmark" which marks the query's current position in the result set. You can pass a bookmark to a query to move the cursor to a certain position in the result set and then query efficiently from there. 
    155155 
    156 Django-nonrel doesn't yet support bookmarks. 
     156This also affects the pagination in the admin interface. Efficient "pagination" would only provide forward/backward navigation without any page numbering. This would also be a candidate for paginating via AJAX (e.g. like in Twitter). 
     157 
     158Django-nonrel doesn't yet support bookmarks, but the App Engine backend provides a private API for them. 
    157159 
    158160= count() = 
     
    160162`Query.count()` is problematic since a scalable `count()` method doesn't exist at least on App Engine. It would be nice to be able to pass an upper limit like `count(100)`, so if there are more than 100 results it will still return just 100. 
    161163 
     164This also affects the results count in the admin interface. 
     165 
    162166Django-nonrel's App Engine backend currently just limits the maximum count to 1000. Other backends don't have a `count()` limit.