summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/traversals.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Test for short term reference cycles and resolve as many as possibleMike Bayer2019-12-301-0/+2
| | | | | | | | Added test support and repaired a wide variety of unnecessary reference cycles created for short-lived objects, mostly in the area of ORM queries. Fixes: #5056 Change-Id: Ifd93856eba550483f95f9ae63d49f36ab068b85a
* Ensure comparison includes "don't compare values" featureMike Bayer2019-12-201-0/+8
| | | | | | | | | | upcoming changes for "expanding IN in all cases" and "lambda elements" both rely upon comparisons that work across changing bound values, so commit the testing fixture ahead of time. Additionally, repair the feature itself within traversals. Change-Id: Ie65a512dc64745614180da77435f9f745ce78c71
* Merge remote-tracking branch 'origin/pr/5031'Mike Bayer2019-12-181-2/+2
|\ | | | | | | Change-Id: I74d94087495de2e0b98b180ef1b5269a72d0c3bf
| * fix typo strucures -> structuresFederico Caselli2019-12-111-2/+2
| |
* | Traversal and clause generation performance improvementsMike Bayer2019-12-141-110/+119
|/ | | | | | | Added one traversal test, callcounts have been brought from 29754 to 5173 so far. Change-Id: I164e9831600709ee214c1379bb215fdad73b39aa
* Add anonymizing context to cache keys, comparison; convert traversalMike Bayer2019-11-041-0/+768
Created new visitor system called "internal traversal" that applies a data driven approach to the concept of a class that defines its own traversal steps, in contrast to the existing style of traversal now known as "external traversal" where the visitor class defines the traversal, i.e. the SQLCompiler. The internal traversal system now implements get_children(), _copy_internals(), compare() and _cache_key() for most Core elements. Core elements with special needs like Select still implement some of these methods directly however most of these methods are no longer explicitly implemented. The data-driven system is also applied to ORM elements that take part in SQL expressions so that these objects, like mappers, aliasedclass, query options, etc. can all participate in the cache key process. Still not considered is that this approach to defining traversibility will be used to create some kind of generic introspection system that works across Core / ORM. It's also not clear if real statement caching using the _cache_key() method is feasible, if it is shown that running _cache_key() is nearly as expensive as compiling in any case. Because it is data driven, it is more straightforward to optimize using inlined code, as is the case now, as well as potentially using C code to speed it up. In addition, the caching sytem now accommodates for anonymous name labels, which is essential so that constructs which have anonymous labels can be cacheable, that is, their position within a statement in relation to other anonymous names causes them to generate an integer counter relative to that construct which will be the same every time. Gathering of bound parameters from any cache key generation is also now required as there is no use case for a cache key that does not extract bound parameter values. Applies-to: #4639 Change-Id: I0660584def8627cad566719ee98d3be045db4b8d