> Or, it's plain true. In SQLA, if you specify lazy loading of relationships 
>> (which is the default), the query is deferred until the first time you 
>> access the attribute, and there is therefore a query for each attribute 
>> accessed. This is in contrast to eager loading, which does a single query 
>> to populate all attributes (whether or not they are ever accessed).
>>  
>>
>
> I was interpreting your statement of "every access" to mean "every time 
> you access the same attribute" and not to mean "every attribute you access".
>

I said, "Lazy loading requires a query for each attribute accessed...". 
That is a fairly precise statement. It is you who made an error.
 

> Anthony, your use of language is sometimes ambiguous - it is not the first 
> time I have misunderstood you - please be more specific next time. 10x :)
>

Interesting that you attribute your misunderstandings to my lack of 
clarity. Is that the only possibility?
 

> As for LazyLoading in web2py:
> We discussed this in the context of virtual-fields, and we've established 
> that Lazyness in that context was NOT a deferred-access to the database, 
> but a deferred-computation of the results  within the run-time heap.
>

No, we didn't establish that at all. I refer you to the written record.
 

> Are you now referring to Laziness in web2py within a different context?
>

No.
 

> Say, like in:
>
db.Country(france).City.find(...)
> ?
>
> Because I don't understand how you would consider to see that as "Lazy" -
>

That is not proper web2py code, so I don't see it as anything.
 

> but a "Lazy access to the database" can only have meaning within the 
> context of a statefull framework.
>

Nope. In web2py, if a Row object contains a reference attribute, a query is 
fired when the attribute is accessed, not when the Row object was first 
created. This is lazy.
 

>
> person =  db.person(id)
> for thing in person.thing.select(orderby=db.thing.name):
>     print person.name, 'owns', thing.name
>
>
> Well, again, it IS "implicit", but why call it "Lazy"?
>

It's actually not even implicit there -- you explicitly call .select(). 
Anyway, "thing" is an attribute of the "person" object, but there is no 
database query to retrieve the "things" when the "person" object is first 
created -- instead, the query for "things" is deferred until actually 
needed.
 

> The "so-called" *LazySet* is in "person.thing" ?
>

Yes.
 

> If so, than it isn't "Lazy", just "implicit" and that's a bad choice of 
> name...
>

Says you.
 

> - good thing it isn't in the documentation, as it would have generated 
> even more confusion than already exists there...
>

More confusion among whom?
 

> The way I see it, the only meaning the term "Lazy" has for 
> accessing-the-database, can exist within a statefull framework - which is, 
> "in relation to eager-loading" that can only exist there.
>

No, web2py could implement eager loading of these Reference and LazySet 
attributes by doing a single query and filling in all the attributes with 
the retrieved values. This would be in contrast to the current behavior, 
which is lazy (i.e., the values are not retrieved when the Row objects are 
initially created but at some later time upon access/explicit request).

Anthony

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to