summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/util.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-12-18 21:50:24 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2019-12-19 10:19:29 -0500
commit7e9f273835ac68df894568ba4292bfbc74ce187b (patch)
tree96d3f1590ff45b90a791f92c622737ed3e89fcfb /lib/sqlalchemy/orm/util.py
parent255a6ee18b9d68b5150f1793e0a318d8ccd913bf (diff)
downloadsqlalchemy-7e9f273835ac68df894568ba4292bfbc74ce187b.tar.gz
Don't apply aliasing + adaption for simple relationship joins
Identified a performance issue in the system by which a join is constructed based on a mapped relationship. The clause adaption system would be used for the majority of join expressions including in the common case where no adaptation is needed. The conditions under which this adaptation occur have been refined so that average non-aliased joins along a simple relationship without a "secondary" table use about 70% less function calls. Change-Id: Ifbe04214576e5a9fac86ca80c1dc7145c27cd50a
Diffstat (limited to 'lib/sqlalchemy/orm/util.py')
-rw-r--r--lib/sqlalchemy/orm/util.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py
index b96387c08..2f78fa535 100644
--- a/lib/sqlalchemy/orm/util.py
+++ b/lib/sqlalchemy/orm/util.py
@@ -1035,6 +1035,7 @@ class _ORMJoin(expression.Join):
source_polymorphic=True,
dest_polymorphic=True,
of_type_mapper=right_info.mapper,
+ alias_secondary=True,
)
if sj is not None: