The toolbar wasn't helpful, as this is a json script, and I didn't want to 
screw with user experiance. Also, the db._timings, I think, is not relevant 
to GAE. I used it and showd 0 queries. But, 
I've used appstats, and found there's no extra query, so I guess I'll have 
to search for the big bucks somwere else.

Thanks you for your help
Yair


On Tuesday, June 4, 2013 6:40:05 PM UTC+3, Anthony wrote:
>
> {{=response.toolbar()}} includes a button for all the queries and their 
> execution times (this is also available as a list of 2-tuples in 
> db._timings).
>
> Anthony
>
> On Tuesday, June 4, 2013 10:05:49 AM UTC-4, guruyaya wrote:
>>
>> OK, so I could be wrong about this. 
>> Is there a way to get the number of GAE datastore reads per request?
>>
>> On Tuesday, June 4, 2013 12:25:06 PM UTC+3, guruyaya wrote:
>>>
>>> Lets examine this code for a sec:
>>> db.define_table('table1',Field('name'))
>>> db.define_table('table2',Field('table1', db.table1), Field('name2'))
>>>
>>> Now, if I need a list of all table2 entries, but not the table1 entries, 
>>> I'll do something like this:
>>>
>>> retVal = []
>>> for entity in db(db.table2.id > 0).select():
>>>     retVal += entity.name2
>>>
>>> BUT
>>> As you well know, web2py acctuall did ask for table1 info, just in case 
>>> I'll do this:
>>>
>>> retVal = []
>>> for entity in db(db.table2.id > 0).select():
>>>     retVal += entity.table1.name
>>>
>>> On a normal hosting, it doesn't matter that much, but on GAE, it does an 
>>> extra query to the datastore, and that's just a waste. 
>>> Is there a way to avoid that?
>>>
>>> Thanks in advance
>>> Yair
>>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to