]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Iterate options per path for baked cache key
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 6 Jun 2018 20:35:34 +0000 (16:35 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 7 Jun 2018 03:58:14 +0000 (23:58 -0400)
commit006da86a398f98b899c04bb9e4eee2e9a4cf10d4
treebeda91e6c0f7dbf1032a1dfcc154510c5ea1870a
parent5bdab5b0eea21d51cc30652c7e3a713c89bfe013
Iterate options per path for baked cache key

Fixed an issue that was both a performance regression in 1.2 as well as an
incorrect result regarding the "baked" lazy loader, involving the
generation of cache keys from the original :class:`.Query` object's loader
options.  If the loader options were built up in a "branched" style using
common base elements for multiple options, the same options would be
rendered into the cache key repeatedly, causing both a performance issue as
well as generating the wrong cache key.  This is fixed, along with a
performance improvement when such "branched" options are applied via
:meth:`.Query.options` to prevent the same option objects from being
applied repeatedly.

Change-Id: I955fe2f50186abd8e753ad490fd3eb8f017e26f9
Fixes: #4270
doc/build/changelog/unreleased_12/4270.rst [new file with mode: 0644]
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/strategy_options.py
test/aaa_profiling/test_orm.py
test/orm/test_options.py
test/profiles.txt