IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 24, 2010, 7:18:05 PM (16 years ago)
Author:
bills
Message:

order pending files by priority. Works but needs optimization.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/share/warptool_towarped.sql

    r27926 r28082  
    1212    workdir,
    1313    magicked,
    14     path_base
     14    path_base,
     15    priority
    1516FROM (
    16     SELECT DISTINCT
     17    (SELECT DISTINCT
    1718        warpSkyCellMap.warp_id,
    1819        warpImfile.warp_skyfile_id,
     
    2728        warpRun.workdir,
    2829        chipRun.magicked,
    29         CAST(NULL AS CHAR(255)) AS path_base
     30        CAST(NULL AS CHAR(255)) AS path_base,
     31        IFNULL(Label.priority, 10000) AS priority
    3032    FROM warpRun
    3133    JOIN warpSkyCellMap
     
    5052    LEFT JOIN warpMask
    5153        ON warpRun.label = warpMask.label
     54    LEFT JOIN Label ON warpRun.label = Label.label
    5255    WHERE
    5356        warpRun.state = 'new'
     
    6063        AND warpMask.label IS NULL
    6164        AND warpSkyCellMap.fault = 0
     65        AND (Label.active OR Label.active IS NULL)
    6266        -- where hook 1 %s
    6367        -- limit hook 1 %s
     68    )
    6469UNION
    65     SELECT
     70    (SELECT
    6671        warpSkyCellMap.warp_id,
    6772        warpImfile.warp_skyfile_id,
     
    7681        warpRun.workdir,
    7782        MIN(chipProcessedImfile.magicked) AS magicked,
    78         warpSkyfile.path_base
     83        warpSkyfile.path_base,
     84        IFNULL(Label.priority, 10000) AS priority
    7985    FROM warpRun
    8086    JOIN warpImfile USING(warp_id)
     
    8692    JOIN rawExp USING(exp_id)
    8793    LEFT JOIN chipProcessedImfile USING(chip_id, class_id)
     94    LEFT JOIN Label ON warpRun.label = Label.label
    8895    WHERE warpRun.state = 'update'
    8996        AND warpSkyfile.data_state = 'update'
     
    94101        -- this blocks processing until all the chip inputs have been destreaked
    95102        AND (warpSkyfile.magicked = 0 OR chipProcessedImfile.magicked >= 0)
     103        AND (Label.active OR Label.active IS NULL)
    96104        -- where hook 2 %s
    97105    GROUP BY warp_id, skycell_id
    98106    HAVING COUNT(warpSkyCellMap.class_id) = COUNT(chipProcessedImfile.class_id)
    99107    -- limit hook 2 %s
     108    )
    100109) as towarped
    101 
Note: See TracChangeset for help on using the changeset viewer.