SELECT st.tagpath as "Point", COALESCE(CASE st.datatype WHEN 0 THEN sd.intvalue WHEN 1 THEN sd.floatvalue end,0) AS "State", CASE sd.dataintegrity WHEN 192 THEN 'Good' WHEN 32 THEN 'Not Reported' WHEN 24 THEN 'Comm Failed' ELSE 'BAD' END AS "Quality", substring(sd.stringValue, 'Operator:\\s(\\S+) ') AS "Operator", TIMESTAMP WITH TIME ZONE 'epoch' + sd.t_stamp * INTERVAL '1 millisecond' || ' ' AS "Timestamp" FROM sqlth_te st, sqlt_data_3_20121113 sd WHERE st.id = sd.tagid AND st.datatype = 0 AND sd.t_stamp > 1352834875059 AND sd.t_stamp < 1352924875059 AND st.tagpath LIKE '%%' UNION SELECT st.tagpath as "Point", COALESCE(CASE st.datatype WHEN 0 THEN sd.intvalue WHEN 1 THEN sd.floatvalue end,0) AS "State", CASE sd.dataintegrity WHEN 192 THEN 'Good' WHEN 32 THEN 'Not Reported' WHEN 24 THEN 'Comm Failed' ELSE 'BAD' END AS "Quality", substring(sd.stringValue, 'Operator:\\s(\\S+) ') AS "Operator", TIMESTAMP WITH TIME ZONE 'epoch' + sd.t_stamp * INTERVAL '1 millisecond' || ' ' AS "Timestamp" FROM sqlth_te st, sqlt_data_3_20121114 sd WHERE st.id = sd.tagid AND st.datatype = 0 AND sd.t_stamp > 1352834875059 AND sd.t_stamp < 1352924875059 AND st.tagpath LIKE '%%' ORDER BY "Timestamp" DESC 12 minutes, 5 seconds
It is supposed to timeout. Are you seeing this on the database status page? We have seen issues (especially with MySQL) where the query never completes and keeps the connection in the pool open. If you edit the connection and press OK it should remove those queries. Is that what happened to you?
Yes this was copied from the status page. There were 12 of these queries running. The box was maxed out at 100% cpu usage. I will try editing the connection next time.