diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-03-09 19:17:45 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-03-09 19:17:45 -0500 |
commit | e7be5a5729cabc6133b4fc83c06f6c5277a7af19 (patch) | |
tree | acca1e4ff7c5683cbd4ae615bd05fc90062c5b2f /test/dialect/test_postgresql.py | |
parent | a1288bf78f887aeef890e4e6cc0f769f4d6a81f5 (diff) | |
download | sqlalchemy-e7be5a5729cabc6133b4fc83c06f6c5277a7af19.tar.gz |
- Changed the underlying approach to query.count().
query.count() is now in all cases exactly:
query.
from_self(func.count(literal_column('1'))).
scalar()
That is, "select count(1) from (<full query>)".
This produces a subquery in all cases, but
vastly simplifies all the guessing count()
tried to do previously, which would still
fail in many scenarios particularly when
joined table inheritance and other joins
were involved. If the subquery produced
for an otherwise very simple count is really
an issue, use query(func.count()) as an
optimization. [ticket:2093]
Diffstat (limited to 'test/dialect/test_postgresql.py')
0 files changed, 0 insertions, 0 deletions