]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Correct cache key for proxy_owner, with_context_options
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 10 May 2021 17:19:14 +0000 (13:19 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 10 May 2021 19:00:41 +0000 (15:00 -0400)
commitf0fc47c11986a0fa60b24c0fb62bd8b5a5306edd
treee5669d5eea2671a39b8596f8e89ee17f84341267
parent17306220498cea779f360d03eeb5aadac3ccb59f
Correct cache key for proxy_owner, with_context_options

Fixed issue in subquery loader strategy which prevented caching from
working correctly. This would have been seen in the logs as a "generated"
message instead of "cached" for all subqueryload SQL emitted, which by
saturating the cache with new keys would degrade overall performance; it
also would produce "LRU size alert" warnings.

In this issue we also observe that the local LRU cache for lazyloader
and selectinloader will get used for all subsequent loads as well,
which makes it more likely to hit the limit of 30.   However rather than
trying to work this out, it would be better if we removed the
loader-local LRU caches altogether once we are confident these
are working well.

Fixes: #6459
Change-Id: Id953e8f75536bb87f7e3315929cebcd8f84a5a50
doc/build/changelog/unreleased_14/6459.rst [new file with mode: 0644]
lib/sqlalchemy/orm/attributes.py
lib/sqlalchemy/orm/context.py
lib/sqlalchemy/orm/util.py
lib/sqlalchemy/sql/base.py
lib/sqlalchemy/sql/traversals.py
lib/sqlalchemy/sql/visitors.py
test/orm/test_cache_key.py
test/orm/test_subquery_relations.py
test/orm/test_utils.py