| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Bryan Cantwell | Date: | March 3 2007 6:38pm |
| Subject: | Need sql optimization help | ||
| View as plain text | |||
I have the following sql that works for what I want to see but is
terribly slow due to the subquery. Any suggestions on how to get same
result faster? I have tried group by and cant seem to get the correct
results that way....
Also is there a product that can help optimize sql and indexing?
SELECT DISTINCT e.severity, e.time_stamp, replace(e.description,
'{HOSTNAME}', h.host) AS description, h.host, h.hostid, e.value,
e.triggerid, s.color FROM fs_events e, hosts h, fs_severity s WHERE
e.hostid = 10011 AND e.hostid = h.hostid AND e.time_stamp = (SELECT
max(time_stamp) FROM fs_events WHERE triggerid = e.triggerid) and
e.severity = s.severityid ORDER BY e.time_stamp DESC
| Thread | ||
|---|---|---|
| • Heavily-loaded MySQL: Resource temporarily unavavailable? | Chris Boot | 2 Mar |
| • Re: Heavily-loaded MySQL: Resource temporarily unavavailable? | Rolando Edwards | 2 Mar |
| • Re: Heavily-loaded MySQL: Resource temporarily unavavailable? | Rolando Edwards | 2 Mar |
| • Re: Heavily-loaded MySQL: Resource temporarily unavavailable? | Chris Boot | 2 Mar |
| • Re: Heavily-loaded MySQL: Resource temporarily unavavailable? | Jay Pipes | 2 Mar |
| • Re: Heavily-loaded MySQL: Resource temporarily unavavailable? | Chris Boot | 2 Mar |
| • Re: Heavily-loaded MySQL: Resource temporarily unavavailable? | Jay Pipes | 2 Mar |
| • Re: Heavily-loaded MySQL: Resource temporarily unavavailable? | Chris Boot | 2 Mar |
| • Need sql optimization help | Bryan Cantwell | 3 Mar |
| • Re: Need sql optimization help | Peter Brawley | 3 Mar |
| • RE: Need sql optimization help | Bryan Cantwell | 3 Mar |
| • Re: Need sql optimization help | Michael Dykman | 3 Mar |
| • Re: Need sql optimization help | Peter Brawley | 3 Mar |
