IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 9, 2014, 2:00:20 PM (12 years ago)
Author:
watersc1
Message:

Change to fake diff level information in the lap JOINs. I've left the
original code in as comments, in case we want to switch back in the
future.

This change makes the execution time of laptool -exposures drop from ~50s to ~0.25s.

File:
1 edited

Legend:

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

    r31511 r37381  
    1 select DISTINCT V3.*,
    2        diffRun.diff_id,diffRun.state as diffRun_state,
    3        coalesce(CONVERT(sum(diffSkyfile.quality != 0),SIGNED),0) AS diff_bad_quality,
    4        coalesce(CONVERT(count(diffSkyfile.diff_id),SIGNED),0) AS diff_component_count
    5        FROM
     1-- Join the diff information
     2-- select DISTINCT V3.*,
     3--       diffRun.diff_id,diffRun.state as diffRun_state,
     4--       coalesce(CONVERT(sum(diffSkyfile.quality != 0),SIGNED),0) AS diff_bad_quality,
     5--       coalesce(CONVERT(count(diffSkyfile.diff_id),SIGNED),0) AS diff_component_count
     6--       FROM
     7select V3.*,-1 as diff_id ,"full" as diffRun_state,0 as diff_bad_quality,0 AS diff_component_count FROM
     8-- Join the warp information
    69( select V2.*,
    710       warpRun.warp_id,warpRun.state as warpRun_state,
     
    1013       warpRun.magicked
    1114       FROM
     15-- Join the camera and fake information
    1216( select V1.*,
    1317       camRun.cam_id,camRun.state as camRun_state,
     
    1519       coalesce(CONVERT(count(camProcessedExp.cam_id),SIGNED),0) AS cam_component_count,
    1620       fakeRun.fake_id,fakeRun.state as fakeRun_state FROM
     21-- Get all the lap, exposure, chip stage information
    1722( SELECT DISTINCT
    1823       lap_id,lapRun.tess_id,projection_cell,filter,lapRun.state as lapRun_state, lapRun.registered, lapRun.fault, lapRun.label, lapRun.dist_group,
     
    2631       GROUP BY lap_id,exp_id
    2732       ) AS V1
     33-- End lap/exposure/chip
    2834       LEFT JOIN camRun USING(chip_id) LEFT JOIN camProcessedExp USING(cam_id)
    2935       LEFT JOIN fakeRun USING(cam_id)
    3036       GROUP BY lap_id,exp_id
    3137  ) AS V2
     38-- End camera/fake
    3239  LEFT JOIN warpRun USING(fake_id) LEFT JOIN warpSkyfile USING(warp_id)
    3340  GROUP BY lap_id,exp_id
    3441) AS V3
    35 LEFT JOIN
    36   (SELECT DISTINCT diff_id,warp1,warp2 FROM diffInputSkyfile) AS DI ON
    37   (DI.warp1 = warp_id OR DI.warp2 = warp_id)
    38 LEFT JOIN diffRun USING(diff_id)
    39 LEFT JOIN diffSkyfile USING(diff_id)
     42-- End warp
     43-- LEFT JOIN
     44--  (SELECT DISTINCT diff_id,warp1,warp2 FROM diffInputSkyfile) AS DI ON
     45--  (DI.warp1 = warp_id OR DI.warp2 = warp_id)
     46-- LEFT JOIN diffRun USING(diff_id)
     47-- LEFT JOIN diffSkyfile USING(diff_id)
    4048GROUP BY lap_id,exp_id
    4149
Note: See TracChangeset for help on using the changeset viewer.