]> 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:49 +0000 (23:58 -0400)
commit99f1239a3e402322d5b4fb49a49b695d6a60c7cd
tree06ad38311f68f0e4bd4ad7029aca22f537aea930
parentfe62e39bf78468a4d7de9176abe6b448e5c4cd4b
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
(cherry picked from commit 006da86a398f98b899c04bb9e4eee2e9a4cf10d4)
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