Apparently redundant subqueryloads with single table inheritance

15 views
Skip to first unread message

Kent

unread,
Jun 5, 2012, 4:21:46 PM6/5/12
to sqlal...@googlegroups.com
I am subquery loading some related properties for a polymorphic inheritance use case similar to the script attached.  SQLA seems to be issuing several extra queries that I didn't expect and don't think it needs.  In the attached example, I expected a total of 4 queries issued for the session.query().get(), but I there are 11 queries instead, most of them redundant.

Any ideas?

Thanks,
Kent
subquery_polymorphic.py

Michael Bayer

unread,
Jun 5, 2012, 4:41:13 PM6/5/12
to sqlal...@googlegroups.com
On Jun 5, 2012, at 4:21 PM, Kent wrote:

I am subquery loading some related properties for a polymorphic inheritance use case similar to the script attached.  SQLA seems to be issuing several extra queries that I didn't expect and don't think it needs.  In the attached example, I expected a total of 4 queries issued for the session.query().get(), but I there are 11 queries instead, most of them redundant.

this is ticket 2480 and has been fixed for several weeks.

0.7.8 is due as we have a memory leak issue but i wont have time for a release until perhaps late weekend.







Any ideas?

Thanks,
Kent

--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/vC69eQMhv10J.
To post to this group, send email to sqlal...@googlegroups.com.
To unsubscribe from this group, send email to sqlalchemy+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
<subquery_polymorphic.py>

Kent Bower

unread,
Jun 5, 2012, 4:39:30 PM6/5/12
to sqlal...@googlegroups.com
Thank you!
Reply all
Reply to author
Forward
0 new messages