Hey Julian,

> That's an interesting idea, for that particular use case.
>
> If I reformulate the "relation index entities" query as I understand
> it:
> 1. [datastore]Traverse the index and return entity keys
> 2. [app engine]Transform returned keys to retrieve parent entity
> 3. [datastore] Batch get of entities
>
> Your idea:
> 1. [datastore]Traverse the index and to get entity keys
> 3. [datastore] Batch get of entities
>
> So you would save step 2, a roundtrip app engine - datastore, not sure
> that's substantial though.

Nice reformulation! However, my proposal would be just a single step:

1. [datastore] Traverse the index and return entities

The only additional cost should be an additional if/else clause when
*writing* entities -- the datastroe would have to look to see if the
entity has an __index__ property. Quite a minimal cost given the
savings otherwise!

Why should it just be a single step? Because of the way that the
datastore works (at least according to the presentation that Ryan gave
last year):

* http://snarfed.org/space/datastore_talk.html

According to it (slide 21):

* Each row in an index table includes the index data and entity key

With my proposal, when an entity is indexed, the key defined in its
__index__ property will be used in place of its own key when the
indexes are constructed...

Of course these special "related entities" would still be accessible
by using their key names...

Hope that makes sense.

-- 
love, tav

plex:espians/tav | t...@espians.com | +44 (0) 7809 569 369
http://tav.espians.com | http://twitter.com/tav | skype:tavespian

--~--~---------~--~----~------------~-------~--~----~
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 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to