IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 22, 2011, 4:12:33 PM (15 years ago)
Author:
bills
Message:

Only add the group by data_group when requested by the user. Use differernt sql
depending on that option.

File:
1 edited

Legend:

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

    r31681 r31687  
    1 SELECT
     1SELECT DISTINCT
    22       tess_id,
    33       skycell_id,
    4        data_group,
    5        label,
    64       num_filter
    75FROM (
     
    97      tess_id,
    108      skycell_id,
    11       label,
    12       data_group,
    139      COUNT(DISTINCT filter) AS num_filter
    1410  FROM stackRun
     
    1814      AND stackSumSkyfile.quality = 0
    1915  -- WHERE hook 1 %s
    20   -- restrict by stackSumSkyfile.good_frac, stackRun.skycell_id, stackRun.label
     16  -- restrict by selected filters, stackSumSkyfile.good_frac, stackRun.skycell_id, stackRun.label
    2117  GROUP BY
    2218      tess_id,
    23       skycell_id,
    24       data_group
    25   ) AS TMP
     19      skycell_id
     20  ) AS Stacks
    2621LEFT JOIN (
    2722  SELECT DISTINCT sky_id,
    2823    stackRun.skycell_id,
    29     stackRun.label,
     24    stackRun.tess_id,
    3025    stackRun.data_group,
    3126    COUNT(stack_id) AS num_filter
     
    3530    JOIN stackSumSkyfile USING(stack_id)
    3631    WHERE 1
     32    -- restrict by selected filters, stackSumSkyfile.good_frac, stackRun.skycell_id, stackRun.label
     33    -- and unless -rerun is supplied that no existing staticskyRun exists
    3734    -- WHERE hook 2 %s
    3835  GROUP BY sky_id
    39  ) AS oldRuns
    40 USING(label, data_group, num_filter, skycell_id)
     36 ) AS ExistingRunsInputs
     37USING(tess_id, skycell_id, num_filter)
    4138WHERE num_filter = %d
    4239-- WHERE hook 3 %s
Note: See TracChangeset for help on using the changeset viewer.