This content has been marked as final.
Show 1 reply
-
1. Re: Is there an efficient way to get a count of all descendant nodes of a given node type?
hchiorean Dec 21, 2015 3:29 AM (in response to ma6rl)Indexes can't handle these type of constraints, so defining/not defining indexes will not make a difference. These type of join-constraints are always handled internally. The only thing that you could improve with your query is not select * but only a simple property (e.g. node.[jcr:name]) since you're only interested in the count.
Apart from this you should try to profile the query and investigate where time is being spent. Using certain JCR features (most notably ACLs) is known to reduce the throughput of queries because each result has to be checked for permissions against the ACL manager.