On Aug 24, 2007, at 1:26 AM, Arun Kumar PG wrote:

> Guys,
>
> Quick clarification:
>
> If we have two tables A and B with relationship keys 'XYZ' in both  
> (B references A) then which is faster:
>
> 1) session.query(A).select_by(*[A.c.XYZ == B.c.XYZ])
>
> or
>
> 2) session.query(A, B).join('XYZ')
>
> 2 should be faster as 1 may require more row scans ?

assuming one is select from a, b and the other is select from a join  
b, theyre equivalent.

>
> Also, the below one is returning multiple records when it should  
> return one (may be join is not happening correctly - anything  
> missing ?.)
>

turn on SQL echoing and see what its doing.


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

Reply via email to