Re: [sqlalchemy] Using the same joinedload object in multiple options causes performance issue with baked queries

2018-06-07 Thread Tom Flannaghan
I've tested your patch against the problematic queries we had, and it completely solves the problem. Thanks! On Wed, 6 Jun 2018 at 21:52 Mike Bayer wrote: > There's a patch at > https://gerrit.sqlalchemy.org/#/c/zzzeek/sqlalchemy/+/771/ which if > you can review against your specific mappings w

Re: [sqlalchemy] Using the same joinedload object in multiple options causes performance issue with baked queries

2018-06-06 Thread Mike Bayer
There's a patch at https://gerrit.sqlalchemy.org/#/c/zzzeek/sqlalchemy/+/771/ which if you can review against your specific mappings would be helpful to confirm this fixed the issue. On Wed, Jun 6, 2018 at 10:32 AM, Tom Flannaghan wrote: > Thanks Mike. I've attached a script that shows the differ

Re: [sqlalchemy] Using the same joinedload object in multiple options causes performance issue with baked queries

2018-06-06 Thread Tom Flannaghan
Thanks Mike. I've attached a script that shows the difference in case that helps. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow

Re: [sqlalchemy] Using the same joinedload object in multiple options causes performance issue with baked queries

2018-06-06 Thread Mike Bayer
On Wed, Jun 6, 2018 at 6:53 AM, Tom Flannaghan wrote: > Hi all, > > We have just upgraded to sqlalchemy 1.2.7 (from 1.1.14), and had a > performance issue with a query that uses a lot of joinedloads that was > caused by the automatic baking of all relationship queries that was > introduced in 1.2.

[sqlalchemy] Using the same joinedload object in multiple options causes performance issue with baked queries

2018-06-06 Thread Tom Flannaghan
Hi all, We have just upgraded to sqlalchemy 1.2.7 (from 1.1.14), and had a performance issue with a query that uses a lot of joinedloads that was caused by the automatic baking of all relationship queries that was introduced in 1.2. Say we have a set of tables with relationships Book.pages, Pa