summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/base.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-08-14 20:00:35 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-08-14 20:00:35 -0400
commit6a21f9e328361d5185fd616e7992a183030f9a10 (patch)
treed5d1ae011a914ac582296b7543dfce5d9833b234 /lib/sqlalchemy/engine/base.py
parent4a4cccfee5a2eb78380e56eb9476e91658656676 (diff)
downloadsqlalchemy-6a21f9e328361d5185fd616e7992a183030f9a10.tar.gz
- The string keys that are used to determine the columns impacted
for an INSERT or UPDATE are now sorted when they contribute towards the "compiled cache" cache key. These keys were previously not deterministically ordered, meaning the same statement could be cached multiple times on equivalent keys, costing both in terms of memory as well as performance. fixes #3165
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
-rw-r--r--lib/sqlalchemy/engine/base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py
index 2dc4d43f2..65753b6dc 100644
--- a/lib/sqlalchemy/engine/base.py
+++ b/lib/sqlalchemy/engine/base.py
@@ -805,7 +805,7 @@ class Connection(Connectable):
dialect = self.dialect
if 'compiled_cache' in self._execution_options:
- key = dialect, elem, tuple(keys), len(distilled_params) > 1
+ key = dialect, elem, tuple(sorted(keys)), len(distilled_params) > 1
if key in self._execution_options['compiled_cache']:
compiled_sql = self._execution_options['compiled_cache'][key]
else: