From 2ef7e6222d77cdae8e4a06730be960fad762461a Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt Date: Sat, 11 Aug 2012 11:38:20 +0200 Subject: [PATCH] dak/control_suite.py: prefetch files table when looking up a binary or source package --- dak/control_suite.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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: -- 2.39.5