Skip to content

Commit

Permalink
Remove superfluous joins from errata view
Browse files Browse the repository at this point in the history
  • Loading branch information
aaannz committed Sep 9, 2024
1 parent 84b9e50 commit e8f5491
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@
--

CREATE OR REPLACE VIEW suseServerChannelsRetractedPackagesView AS
SELECT DISTINCT p.id AS pid,
s.id AS sid
FROM rhnserver s
JOIN rhnserverchannel sc ON s.id = sc.server_id
SELECT DISTINCT ep.package_id AS pid,
sc.server_id AS sid
FROM rhnserverchannel sc
JOIN rhnchannel c ON c.id = sc.channel_id
JOIN rhnchannelerrata ce ON ce.channel_id = c.id
JOIN rhnerrata e ON e.id = ce.errata_id
JOIN rhnerratapackage ep ON ep.errata_id = e.id
JOIN rhnpackage p ON p.id = ep.package_id
WHERE e.advisory_status::text = 'retracted'::text;

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- remove superfluous joins from errata view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CREATE OR REPLACE VIEW suseServerChannelsRetractedPackagesView AS
SELECT DISTINCT ep.package_id AS pid,
sc.server_id AS sid
FROM rhnserverchannel sc
JOIN rhnchannel c ON c.id = sc.channel_id
JOIN rhnchannelerrata ce ON ce.channel_id = c.id
JOIN rhnerrata e ON e.id = ce.errata_id
JOIN rhnerratapackage ep ON ep.errata_id = e.id
WHERE e.advisory_status::text = 'retracted'::text;

0 comments on commit e8f5491

Please sign in to comment.