wiki:db/queries/048
Last modified 6 years ago Last modified on 02/01/2013 12:23:53 AM

Select all variable objects in clusters

This query was suggested by the LSST Science Collaboration (Supernovae)

SELECT objectId
FROM   (SELECT v.objectId AS objectId, 
               COUNT(n.neighborObjectId) AS neighbors
        FROM   VarObject v
        JOIN   Neighbors n USING (objectId)
        WHERE  n.distance < :clusterRadiusThreshold
        GROUP BY v.objectId) AS C
WHERE  neighbors > :clusterDensityThreshold

Assumes presence of Neighbors table.