There is a difference between queries and lookups. Unfortunately I'm typing
on my android and can't give you all the details, but this should be a good
start. Go for option 1) because its 0 queries and 4 lookups.

Cheers , Andrin
On Feb 8, 2012 8:15 PM, "steven" <jobshif...@gmail.com> wrote:

> Hi:
>
> Thank you in advance
>
> I have a question about Datastore API calls.
>
> Suppose I have a one-to-many relation ship, with two solutions as
> below:
>
> 1) solution 1
> class A
> {
>    set<key> keys_for_B
> }
>
> the instance is a1 contains <b1, b2, b3>
>
> if I query for a1, and then I can get keys of b1, b2, b3; and then I
> read the b1, b2, b3.
> Does it mean there are 4 calls to datastore API calls?
>
>
> 2) solution 2
> I build a "big-table" as
> a1, b1
> a1, b2
> a1, b3
>
> and then query as "select * from mytable where a_id = a1_id", to get 3
> rows
> I guess there is just one call, to datastore.
>
> comparing solution 1 and 2, does it mean Google will charge me 4 times
> money for solution 1?
>
> thank you very much,
> Sincerely,
> Steven
>
>
>
>
>
>
>
> --
> 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.
>
>

-- 
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