Index: trunk/ippTools/share/magictool_definebyquery.sql
===================================================================
--- trunk/ippTools/share/magictool_definebyquery.sql	(revision 18669)
+++ trunk/ippTools/share/magictool_definebyquery.sql	(revision 18672)
@@ -43,4 +43,5 @@
 WHERE
     diffSkyfile.fault = 0
+-----    AND warpSkyfile.good_frac >= 0.5
 -- magictool_definebyquery_temp_insert_groupby.sql
 GROUP BY
@@ -54,5 +55,8 @@
 -- After this follows magictool_definebyquery_select_part2.sql
 SELECT
-    *
+    exp_id,
+    filter,
+    num_todo,
+    num_done
 FROM (
     -- Number of skycells as a function of exposure
@@ -72,4 +76,5 @@
         AND warpRun.state = 'stop'
     -- INSERT HERE any additional restrictions (e.g., exp_id, warpSkyfile.good_frac)
+-----        AND warpSkyfile.good_frac > 0.5
 -- INSERT HERE magictool_definebyquery_select_part2.sql
 -- magictool_definebyquery_select_part2.sql
@@ -92,5 +97,5 @@
     num_done = num_todo
     AND magicRun.magic_id IS NULL
-
+;
 
 -- magictool_definebyquery_insert.sql
@@ -102,2 +107,3 @@
     CONCAT(tess_id, '.', skycell_id) AS node
 FROM magicBestDiffs
+;
