Hi,

The difference is: in 3) you give the key of the ancestor and the ds
will return you the keys of the entities having this ancestor
(potentially more than 1 one) and in 2) you give the key of the entity
that you want to check itself.

in 2) you can get the key from "somewhere" without having to know if
this key contains the key of an ancestor (defining an entity group) or
not. In  3), you must have a better understanding of the underlying
app.

regards

didier

On Jan 2, 11:47 am, "ss.require" <ss.requ...@gmail.com> wrote:
> > You're right about 2): more efficient because only key is accessed: i/
> > o limited to index rather than index + table when you fetch the entire
> > entity. So more disk i/o and more bytes to transfer between the
> > datastore server and the server of your jvm.
>
> OK
>
> > About 3): 2 important points come to mind: (a) using ancestor key
> > means that you know how your entities are grouped in the datastore for
> > transactional purposes: i.e you need to know the parent for each
> > entity key you want to check  
>
> But I also need to know the parent key for '2)' way. What is the
> difference?
>
> >and (b) according to this grouping, get
> > on 1 ancestor key may return more than 1 child entity and then you may
> > lose the performance optimization that you are looking for.
>
> When I call setAncestor() I pass the complete key: all parents keys +
> the entity key. So query can't return more than 1 entity.
>
> So I don't see the benefit from '2)' way accoring to your reply.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to