[appengine-java] Re: Database cursor for back cursor?

2010-04-30 Thread boustanihani
Guys I think cursors are the best choice for paging ... It is also safe to send a cursor to the client and this is exactly what i am doing ... I am saving all cursors on the client in an ArrayList and using them to page forward and backward ... of coarse u have to start by page 1 and move forward

[appengine-java] Re: Database cursor for back cursor?

2010-04-26 Thread Alfred Fuller
For most queries the process goes something like this: Index Scan - Fetch Entity - Send to user For any query with a sort order or inequality filter on any property other than __key__ we are still actually fetching the entity in the datastore, so the only savings is the serialization and

[appengine-java] Re: Database cursor for back cursor?

2010-04-26 Thread Alfred Fuller
This isn't a bad solution, but it has several problems: - It doesn't scale - Cache could have holes. I guess then you could grab a query and scroll though the first 20 pages to fill out the cache. You could actually start at the highest cursor before the requested page and page forward to fill

[appengine-java] Re: Database cursor for back cursor?

2010-04-23 Thread boustanihani
To achieve this I am saving all corsors (in an ArrayListString) on the Client and reusing them for getting bachward pages :) ... this works! What do u think? On 2 Apr., 21:57, Arny arny...@googlemail.com wrote: Hi, Is there a way to get acursorto pagebackto a previous page? If not, whats the

Re: [appengine-java] Re: Database cursor for back cursor?

2010-04-06 Thread Ikai L (Google)
Offset doesn't fetch data - it does an index scan. Going to the 10,000th result using offset will require us to pass 10,000 results first in our index, but we won't be retrieving those objects. Here's a bit of a simplification of indexes, entities and how these queries work. As you know, Bigtable

Re: [appengine-java] Re: Database cursor for back cursor?

2010-04-06 Thread Ikai L (Google)
We get a list of Keys back and figure out keys. I just realized how confusing this is - we get a list of INDEX keys back. These don't have any value; we do all storage inside the Key. We extract the keys of the Entity from the returned Index keys and do a query. On Tue, Apr 6, 2010 at 11:42 AM,

[appengine-java] Re: Database cursor for back cursor?

2010-04-03 Thread Arny
But isn't it getting slower and slower on higher pages, since it fetches ALL data (according to docs) and discards the offset value? So Range(0,10) is faster than Range(1,10) ? Anyone did some performance tests? Regards On Apr 3, 7:49 am, John Patterson jdpatter...@gmail.com wrote: Probably

Re: [appengine-java] Re: Database cursor for back cursor?

2010-04-03 Thread John Patterson
How many pages do your users really want to see? Even Google search sets a limit - I think 1000 results. Although the number of results can exceed 1000 the offset is still limited so you would need to filter out results to continue past 1K. That would be slow. If you really need to