sorry for overload the list with random questions.  i'm trying to get a 
release out the door and dealing with performance bottlenecks...

given this setup:

   class Items2Attributes(base):
       id
       item_id
       condition_id 
       attribute_id

    class Items(base):
       id
       to_attributes_a = 
sa.orm.relationship(items.id==Items2Attributes.item_id, 
Items2Attributes.condition_id=="a")
       to_attributes_b = 
sa.orm.relationship(items.id==Items2Attributes.item_id, 
Items2Attributes.condition_id=="b")

I achieved a greater performance boost moving 'to_attributes_X' into a 
subueryload from a joinedload.

I'm getting a bit of a ding from having 2 subqueryloads though.

Are there any ways to load both `to_attributes_a` and `to_attributes_b` 
with a single request ?

i thought the syntax `subqueryload('to_attributes_a','to_attributes_b')` 
might work, but that is for loading paths [e.g. "to_attributes_a" and 
"to_attributes_a.to_attributes_b" ]  makes perfect sense.

i totally understand this is a bit of an edge case.  I doubt many people 
encounter multiple relationships to the same tables.  i'm just hitting this 
table 2x for a nearly identical query. if anyone knows of a workaround, I 
'd be grateful. 



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

Reply via email to