-JOIN override o ON o.package = s.source
-JOIN section sec ON o.section = sec.id
-JOIN priority pri ON o.priority = pri.id
+JOIN files_archive_map fam
+ ON fam.file_id = f.id
+ AND fam.archive_id = (SELECT archive_id FROM suite WHERE id = :suite)
+ AND fam.component_id = :component
+LEFT JOIN override o ON o.package = s.source
+ AND o.suite = :overridesuite
+ AND o.component = :component
+ AND o.type = :dsc_type
+LEFT JOIN section sec ON o.section = sec.id
+LEFT JOIN priority pri ON o.priority = pri.id