IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 26, 2009, 2:03:56 PM (17 years ago)
Author:
bills
Message:

progress on query for components ready to be processed

File:
1 edited

Legend:

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

    r23254 r23566  
    22SELECT
    33    distRun.dist_id,
     4    distRun.label,
    45    stage,
    56    stage_id,
     
    89    rawExp.camera,
    910    outroot,
    10     rawImfile.uri as path_base,
     11    rawImfile.uri as path_base,         -- change this once rawImfile has path_base
    1112    chipProcessedImfile.path_base as chip_path_base,
    1213    NULL as state,
     
    1516FROM distRun
    1617JOIN rawExp ON exp_id = stage_id
    17 JOIN rawImfile using(exp_id)
     18JOIN (                      -- find the last magicked chip run
     19    SELECT
     20        exp_id,
     21        MAX(chip_id) AS chip_id
     22    FROM chipRun
     23    WHERE
     24        chipRun.state = 'full'
     25        AND chipRun.exp_id = exp_id
     26        --   AND chipRun.magicked
     27        -- magicked hook 1 %s
     28        GROUP BY exp_id
     29    ) AS bestChipRun
     30    USING(exp_id)
     31JOIN rawImfile USING(exp_id)
    1832JOIN chipProcessedImfile
    19     ON distRun.chip_id = chipProcessedImfile.chip_id
    20     AND rawImfile.class_id = chipProcessedImfile.class_id
     33    USING(exp_id, chip_id, class_id)
    2134LEFT JOIN distComponent
    2235    ON distRun.dist_id = distComponent.dist_id
     
    2639    AND distRun.stage = 'raw'
    2740    AND distComponent.dist_id IS NULL
     41    -- if magicked add AND rawImfile.magicked here
     42    -- where hook 1 %s
    2843
    2944-- chip stage
     
    3146SELECT
    3247    distRun.dist_id,
     48    distRun.label,
    3349    stage,
    3450    stage_id,
     
    5369    AND distRun.stage = 'chip'
    5470    AND distComponent.dist_id IS NULL
    55 UNION
    56 SELECT
    57     distRun.dist_id,
     71    -- where hook 2 %s
     72UNION
     73SELECT
     74    distRun.dist_id,
     75    distRun.label,
     76    stage,
     77    stage_id,
     78    chipProcessedImfile.class_id AS component,
     79    clean,
     80    rawExp.camera,
     81    outroot,
     82    camProcessedExp.path_base,
     83    chipProcessedImfile.path_base as chip_path_base,
     84    camRun.state,
     85    NULL,
     86    0
     87FROM distRun
     88JOIN camRun ON camRun.cam_id = distRun.stage_id
     89JOIN camProcessedExp USING(cam_id)
     90JOIN chipRun USING(chip_id)
     91JOIN chipProcessedImfile USING(exp_id, chip_id)
     92JOIN rawExp using(exp_id)
     93LEFT JOIN distComponent
     94    ON distRun.dist_id = distComponent.dist_id
     95    AND chipProcessedImfile.class_id = distComponent.component
     96WHERE
     97    distRun.state = 'new'
     98    AND distRun.stage = 'camera'
     99    AND distComponent.dist_id IS NULL
     100    -- where hook 3 %s
     101UNION
     102SELECT
     103    distRun.dist_id,
     104    distRun.label,
     105    stage,
     106    stage_id,
     107    fakeProcessedImfile.class_id AS component,
     108    clean,
     109    rawExp.camera,
     110    outroot,
     111    fakeProcessedImfile.path_base,
     112    NULL,
     113    fakeRun.state,
     114    NULL,
     115    0
     116FROM distRun
     117JOIN fakeRun ON fakeRun.fake_id = distRun.stage_id
     118JOIN fakeProcessedImfile USING(fake_id)
     119JOIN camRun USING(cam_id)
     120JOIN chipRun USING(chip_id, exp_id)
     121JOIN rawExp using(exp_id)
     122LEFT JOIN distComponent
     123    ON distRun.dist_id = distComponent.dist_id
     124    AND fakeProcessedImfile.class_id = distComponent.component
     125WHERE
     126    distRun.state = 'new'
     127    AND distRun.stage = 'fake'
     128    AND distComponent.dist_id IS NULL
     129    -- where hook 4 %s
     130UNION
     131SELECT
     132    distRun.dist_id,
     133    distRun.label,
    58134    stage,
    59135    stage_id,
     
    81157    AND distRun.stage = 'warp'
    82158    AND distComponent.dist_id IS NULL
    83 UNION
    84 SELECT
    85     distRun.dist_id,
     159    -- where hook 5 %s
     160UNION
     161SELECT
     162    distRun.dist_id,
     163    distRun.label,
    86164    stage,
    87165    stage_id,
     
    108186    AND distRun.stage = 'diff'
    109187    AND distComponent.dist_id IS NULL
     188    -- where hook 6 %s
    110189UNION
    111190SELECT DISTINCT
    112191    distRun.dist_id,
     192    distRun.label,
    113193    stage,
    114194    stage_id,
     
    152232    AND distRun.stage = 'stack'
    153233    AND distComponent.dist_id IS NULL
     234    -- where hook 7 %s
    154235) as Foo
Note: See TracChangeset for help on using the changeset viewer.