Subversion Repositories DevTools

Rev

Rev 7247 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
7240 dpurdie 1
-- Used to determine the possible build time of a package, including
2
-- the ripple effects. Used to provide the user with an indication
3
--  CalcRippleTime.sql
4
--
5
--      :RTAG_ID
6
--      :PV_ID
7
--
8
-- All the package-versions that use a specified package-version in a specified release
9
--
10
-- Note: The outer join of release_content was causing a slow query
11
--       This sql is a bit faster
12
--
13
-- Based on UsedByAllPackagesInThisRelease.asp
14
--          Chnages to improve the performance of that query could be used here too
15
--
16
With small_pd as ( SELECT pv1.build_time, pd.*, pd.pkg_id || pv1.v_ext as pkg_sig, pd.dpkg_id || pv2.v_ext as dpkg_sig 
17
                    FROM package_dependencies pd, package_versions pv1, package_versions pv2 
18
                    WHERE pv1.pv_id IN ( SELECT pv_id FROM release_content WHERE rtag_id = :RTAG_ID ) 
19
                    AND pd.pv_id = pv1.pv_id AND pd.dpv_id = pv2.pv_id ),
20
aa as (SELECT * from (
21
    SELECT pv_id, build_time 
22
        FROM small_pd pd connect by prior pkg_sig = dpkg_sig start with dpkg_sig in (SELECT pkg_id || v_ext FROM package_versions where pv_id = :PV_ID )
23
    UNION
24
     SELECT pv_id, build_time from package_versions where pv_id = :PV_ID
25
) ), 
26
total as (SELECT sum(bd.build_time) as BuildTime, 1 as item
27
            FROM aa bd , release_content rc 
28
            WHERE rc.rtag_id(+) = :RTAG_ID 
29
             AND  rc.pv_id(+) =  bd.pv_id ),
30
pbt as (SELECT build_time as BuildTime, 1 as item from package_versions where pv_id = :PV_ID )
31
select total.buildtime as Total_BuildTime, pbt.BuildTime  from total, pbt where total.item = pbt.item