Skip to content

Instantly share code, notes, and snippets.

@Spaider
Created May 11, 2015 10:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Spaider/1d1fa643477d8d3103ed to your computer and use it in GitHub Desktop.
Save Spaider/1d1fa643477d8d3103ed to your computer and use it in GitHub Desktop.
neo4j health summary
with summary as (
select
r.QueryId,
r.QueryTime,
r.Result,
row_number() over (partition by r.QueryId order by r.QueryTime desc) as rk
from vr_t_Neo4jHealthResult r
)
select
s.QueryId,
s.QueryTime,
q.Comment,
s.Result,
case q.Severity
when 0 then 'Stats'
when 1 then 'Warning'
when 2 then 'Critical'
end
from
summary s
inner join vr_t_Neo4jHealthQuery q
on q.QueryId = s.QueryId
where
s.rk = 1
order by
q.Severity desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment