I have a model with a relationship:

class Customer(Base):

    __tablename__ = 'customer'
        ...
    customer_wishes = relationship('CustomerWish', back_populates='customer', 
lazy='subquery')

When I query a customer from the db:

15:32:00    INFO [sqlalchemy.colorsql]:  0.005s  SELECT * FROM customer WHERE 
customer.id = 1599622
15:32:00    INFO [sqlalchemy.colorsql]:  0.004s  SELECT * FROM (SELECT 
customer.id AS customer_id FROM customer WHERE customer.id = 1599622) AS 
anon_1
JOIN customer_wish ON anon_1.customer_id = customer_wish.customer_id
ORDER BY anon_1.customer_id

This "SELECT customer.id AS customer_id FROM customer WHERE customer.id = 
1599622" looks strange. Not sure if this affects performance, otherwise 
does this have any meaning?

-- 
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/groups/opt_out.

Reply via email to