SELECT CASE WHEN cast(to_char((now()-t0.time),'SSSS') as numeric)>th.heartbeat_interval THEN 'online' ELSE 'offline' END AS "Status", th._ident, t0.time AT TIME ZONE 'GMT', t0.usec, t0.gmtoff FROM prelude_heartbeat as th left join prelude_createtime as t0 on (t0._message_ident = 621 and 621 = th._ident and t0._parent_type = 'H') WHERE t0.time IS NOT NULL