From: Ansgar Burchardt Date: Sat, 11 Aug 2012 09:38:20 +0000 (+0200) Subject: dak/control_suite.py: prefetch files table when looking up a binary or source package X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ef7e6222d77cdae8e4a06730be960fad762461a;p=dak dak/control_suite.py: prefetch files table when looking up a binary or source package --- diff --git a/dak/control_suite.py b/dak/control_suite.py index cdce40c5..fecd7640 100755 --- a/dak/control_suite.py +++ b/dak/control_suite.py @@ -75,10 +75,12 @@ Display or alter the contents of a suite using FILE(s), or stdin. def get_pkg(package, version, architecture, session): if architecture == 'source': - q = session.query(DBSource).filter_by(source=package, version=version) + q = session.query(DBSource).filter_by(source=package, version=version) \ + .join(DBSource.poolfile) else: q = session.query(DBBinary).filter_by(package=package, version=version) \ - .join(DBBinary.architecture).filter(Architecture.arch_string.in_([architecture, 'all'])) + .join(DBBinary.architecture).filter(Architecture.arch_string.in_([architecture, 'all'])) \ + .join(DBBinary.poolfile) pkg = q.first() if pkg is None: