> I have an object from the ORM called obj which has an attribute
> obj.related_objects.
> 
> If I do "for ro in obj.related_objects:" does that do a query for each
> iteration?
> 
> I have thousands of related_objects per obj and it is not as fast as i
> would like.

It will if you don't eager load the related objects.  See this section of the 
ORM tutorial for more information about this:

http://www.sqlalchemy.org/docs/05/ormtutorial.html?highlight=lazy#working-with-related-objects

Michael

--

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


Reply via email to