On Tue, Oct 9, 2012 at 10:40 AM, James Gilliam <[email protected]> wrote:
> The main point I am making is offsets are useless because reading all
> records from 0 to offset costs the same as reading a a record from +offset.
> If GAE didn't charge for the records being skipped, it would be useful to
> use offsets. I suspect the only reason they charge for skipping records is
> because they cannot locate the nth record without reading them all.  This
> suggests a defect in their design that has nothing to do with entity
> database.

This is a defect in pretty much all database designs.  What do you
think MySQL does when you specify an offset?  It runs the query and
walks through the result set until it has skipped N results.  It's
only fast in MySQL if you have all the necessary indexes in RAM; GAE
is designed for very large datasets so you can't make this assumption.
 This is one quirk of GAE; it's not very convenient for small
datasets.  But your app won't suddenly collapse under load when the
index grows beyond an arbitrary point.

You could make an argument that GAE offsets should be small ops
instead of read ops.  But you can easily make this happen yourself -
issue a keys-only query and batch get the results.  Performance of
keys-only + batch-get is fairly similar to normal query performance.

Jeff

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
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