[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] dak/control_suite.py: prefetch files table when looking up a binary or source package



---
 dak/control_suite.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dak/control_suite.py b/dak/control_suite.py
index cdce40c..fecd764 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:
-- 
1.7.2.5



Reply to: