diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-04-16 23:58:48 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-04-17 00:10:00 -0400 |
commit | 46f34449f389a8aa994485f36e99f95275a19170 (patch) | |
tree | ed70e4837430c5f2f99d31391607b361b339243e /lib/sqlalchemy/sql/compiler.py | |
parent | b73fc8f874da94c9c5b2d94feb6b1b45b7f4f02b (diff) | |
download | sqlalchemy-46f34449f389a8aa994485f36e99f95275a19170.tar.gz |
Uniquify FROMs when traversing through select
Fixed a critical performance issue where the traversal of a
:func:`_sql.select` construct would traverse a repetitive product of the
represented FROM clauses as they were each referred towards by columns in
the columns clause; for a series of nested subqueries with lots of columns
this could cause a large delay and significant memory growth. This
traversal is used by a wide variety of SQL and ORM functions, including by
the ORM :class:`_orm.Session` when it's configured to have
"table-per-bind", which while this is not a common use case, it seems to be
what Flask-SQLAlchemy is hardcoded as using, so the issue impacts
Flask-SQLAlchemy users. The traversal has been repaired to uniqify on FROM
clauses which was effectively what would happen implicitly with the pre-1.4
architecture.
Fixes: #6304
Change-Id: I43497e943db4065deab0bfc830fbb68c17b80a53
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
0 files changed, 0 insertions, 0 deletions