thanks.

在 2014年7月26日星期六UTC+8上午9时02分35秒,Jay写道:
>
> I just deployed a little test app. It is under quota so I don't think 
> appstats is reporting that for me.
>
> However, the important thing to note in this context is that whether I use 
> the db api or ndb, it is the same datastore operation ... which is a query 
> in this case.
>
> If you still need "proof", I suggest you write your own test application. 
> As Vinny suggested, you can post that and there might be some more 
> discussion to come from it.
>
> On Friday, July 25, 2014 9:26:27 AM UTC-5, saintthor wrote:
>>
>> how many entities is in your db? how many ops cost for one call?
>>
>> 在 2014年7月25日星期五UTC+8上午8时03分44秒,Jay写道:
>>>
>>> I wrote a simple test app that used both the db and ndb api and deployed 
>>> it to app engine. Using appstats I confirmed that both RunQuery when 
>>> getting the list of articles.
>>>
>>> On Wednesday, July 23, 2014 8:03:40 PM UTC-5, Jay wrote:
>>>>
>>>> I refer you to line 3865 of __init__ in the ext.db package in the sdk. 
>>>> This is on a _ReverseReferenceProperty that gets setup.
>>>> If I have time tomorrow I will write a quick test to demonstrate.
>>>>
>>>> On Wednesday, July 23, 2014 11:11:31 AM UTC-5, saintthor wrote:
>>>>>
>>>>> are you sure?
>>>>>
>>>>> i tested in two apps. the first is using query. when i do a query, the 
>>>>> read ops increases about 300. the second is using referenceproperty as 
>>>>> above, after 5 times showing, there is no obviously increase.
>>>>>
>>>>> the articles in the second app is much more than the first. so i don't 
>>>>> think it run a query.
>>>>>
>>>>> 在 2014年7月22日星期二UTC+8下午11时20分14秒,Jay写道:
>>>>>>
>>>>>> When you use that api in db, it is doing a query underneath the 
>>>>>> covers.
>>>>>>
>>>>>> On Monday, July 21, 2014 11:27:08 PM UTC-5, saintthor wrote:
>>>>>>>
>>>>>>> in db, i set such a property in model article:
>>>>>>>
>>>>>>> auth = db.ReferenceProperty( author, collection_name="AuthSet" )
>>>>>>>
>>>>>>>
>>>>>>> and use author.AuthSet to get all articles written by the certain 
>>>>>>> author. there is no query. how can i do the same thing in ndb?
>>>>>>>
>>>>>>>
>>>>>>> 在 2014年7月22日星期二UTC+8上午3时55分28秒,Jay写道:
>>>>>>>>
>>>>>>>> Responding to your first post ... that is right. The parent key is 
>>>>>>>> part of the entity's key. When you use get_by_id, this is just 
>>>>>>>> shorthand 
>>>>>>>> for Key('Foo', 99).get().
>>>>>>>> You cannot get an entity by key unless you know the key, the whole 
>>>>>>>> key. 
>>>>>>>>
>>>>>>>> You say you don't want to query, but your use case ... "give me all 
>>>>>>>> articles for user A" ... sounds like a query. 
>>>>>>>> articles = Article.query(Article.author == user_key)...
>>>>>>>>
>>>>>>>> If you want to do something like "most recent n articles" then you 
>>>>>>>> can store those keys in a 'secondary index' of sorts and use 
>>>>>>>> ndb.get_multi()
>>>>>>>>
>>>>>>>> On Monday, July 21, 2014 8:11:20 AM UTC-5, saintthor wrote:
>>>>>>>>>
>>>>>>>>> to query may cost too many ops. i don't query.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> 在 2014年7月21日星期一UTC+8下午8时53分29秒,Kaan Soral写道:
>>>>>>>>>>
>>>>>>>>>> Not associated with google, also not an expert on ndb
>>>>>>>>>>
>>>>>>>>>> As far as I know key groups are related with consistency, in my 
>>>>>>>>>> opinion, you shouldn't put article's and author's in the same group, 
>>>>>>>>>> there 
>>>>>>>>>> is a 1/s write speed limit on entity groups, if you put them in the 
>>>>>>>>>> same 
>>>>>>>>>> entity group, you could hit this limit more easily
>>>>>>>>>>
>>>>>>>>>> You don't even have to use referenceproperty's - I would just put 
>>>>>>>>>> the author key in an article StringProperty named "author" and query 
>>>>>>>>>> for 
>>>>>>>>>> it, if I were you
>>>>>>>>>>
>>>>>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/d/optout.

Reply via email to