diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-03-10 18:23:23 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-03-10 18:23:23 -0400 |
| commit | 201ba16fc88439fa100023369dfdfe22625253c9 (patch) | |
| tree | 66737cff2b959230969580d1cbbb3b921c778179 /lib/sqlalchemy/orm | |
| parent | 66fa5b50a53ebe234f19e23b7dfa6ff310969996 (diff) | |
| download | sqlalchemy-201ba16fc88439fa100023369dfdfe22625253c9.tar.gz | |
- The subquery wrapping which occurs when joined eager loading
is used with a one-to-many query that also features LIMIT,
OFFSET, or DISTINCT has been disabled in the case of a one-to-one
relationship, that is a one-to-many with
:paramref:`.relationship.uselist` set to False. This will produce
more efficient queries in these cases.
fixes #3249
Diffstat (limited to 'lib/sqlalchemy/orm')
| -rw-r--r-- | lib/sqlalchemy/orm/strategies.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/strategies.py b/lib/sqlalchemy/orm/strategies.py index 25a27885b..611635333 100644 --- a/lib/sqlalchemy/orm/strategies.py +++ b/lib/sqlalchemy/orm/strategies.py @@ -1269,7 +1269,7 @@ class JoinedLoader(AbstractRelationshipLoader): anonymize_labels=True) assert clauses.aliased_class is not None - if self.parent_property.direction != interfaces.MANYTOONE: + if self.parent_property.uselist: context.multi_row_eager_loaders = True innerjoin = ( |
