Increase performance of foreign admins query

master
Andy Robbins 2019-02-27 15:55:00 -08:00 committed by GitHub
parent ccbe0a9132
commit aff6f8f25b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -351,10 +351,10 @@ export default class DomainNodeData extends Component {
property="Foreign Admins"
target={this.state.label}
countQuery={
"OPTIONAL MATCH p = (n:User)-[:MemberOf*1..]->(:Group)-[:AdminTo]->(c:Computer) WHERE c.domain = {name} AND NOT n.domain = {name} RETURN count(distinct(n)) UNION ALL OPTIONAL MATCH p = (n:User)-[:AdminTo]->(c:Computer) WHERE c.domain = {name} AND NOT n.domain = {name} RETURN count(distinct(n))"
"MATCH (u:User) WHERE NOT u.domain = {name} OPTIONAL MATCH (u)-[:AdminTo]->(c {domain:{name}}) OPTIONAL MATCH (u)-[:MemberOf*1..]->(:Group)-[:AdminTo]->(c {domain:{name}}) RETURN COUNT(DISTINCT(u))"
}
graphQuery = {
"OPTIONAL MATCH p = (n:User)-[:MemberOf*1..]->(:Group)-[:AdminTo]->(c:Computer) WHERE c.domain = {name} AND NOT n.domain = {name} RETURN p UNION ALL OPTIONAL MATCH p = (n:User)-[:AdminTo]->(c:Computer) WHERE c.domain = {name} AND NOT n.domain = {name} RETURN p"
"MATCH (u:User) WHERE NOT u.domain = {name} OPTIONAL MATCH p1 = (u)-[:AdminTo]->(c {domain:{name}}) OPTIONAL MATCH p2 = (u)-[:MemberOf*1..]->(:Group)-[:AdminTo]->(c {domain:{name}}) RETURN p1,p2"
}
/>