Purpose
This page provides the cypher query to get the top 5 tables with most updates.
Applicable Platform or <Sub Platform Version>
Imaging System | Yes/No |
---|---|
>2.x |
Details
Run the below query in neo4j database to get top 5 tables with most updates
MATCH (o:{appname})-[r:USE]->(t:Object:{appname}) WHERE t.Type CONTAINS "Table" and (o:Object or o:SubObject) WITH DISTINCT r.aipLinkType as linkTypes, o, t UNWIND linkTypes as lt WITH lt,linkTypes, o, t MATCH(o1:{appname}) where lt = "update" and (o1:Object or o1:SubObject) RETURN DISTINCT lt as `Link Type`,COUNT(DISTINCT o) as `No. of Updates`, t.Type as `Target Type`, t.FullName as `Target FullName`, t.Name as `Target Name`order by `No. of Updates` desc limit 5
Notes/comments
Note: Please replace {appname} with the application name
Have placed limit 5 to get topmost tables but suppose if 6 tables have same value it will give only first 5, so better to run without limit 5 condition and then take topmost tables.
Related Pages