I think you don't need the second index lookup.
It will faster to just let the matcher do it's job.
It will only aggregate on n.UID, r.name
(don't know what r.name is)
please note that count(*) counts the total rows generated by the matcher, not
the distinct data elements.
you probably want to use count(distinct u.UUID)
Michael
> START n=node:NODE("(UUID:1 OR UUID:2 OR UUID:3 OR UUID:4 OR UUID:5) AND
> OBJECTTYPE:USER")
> MATCH n<-[r:FOLLOWS|KNOWS]-u
> WITH n.UUID AS UUID,r.name AS RELATION,count(*) AS TOTAL,collect(DISTINCT
> u.UUID) AS ALL
> RETURN UUID,RELATION,TOTAL,"7" IN ALL AS EXIST
Am 14.05.2014 um 13:33 schrieb Biswajit Kumar Das <[email protected]>:
> Hi
> I am not so new in Neo4J, but our Neo4J engine is old (Neo4j - Graph Database
> Kernel 1.9) We have a very simple query running as down below
> Where I am trying to find out some user's total follow and know and whether a
> specific user exist in them. Am I doing this wrong? :(
> Because it behaves differently when the relationship increases. The TOTAL and
> EXIST value starts coming wrong. I even checked out each relationship,
> whether they exists or not, they do. Sometimes relations are between the
> nodes of same set (Could this be any issue?). So I tried to decrease the
> relations and again it starts coming correct. Where I am doing wrong?
>
> Thanks in advance
>
> Regards
> Biswajit
>
> START n=node:NODE("(UUID:1 OR UUID:2 OR UUID:3 OR UUID:4 OR UUID:5) AND
> OBJECTTYPE:USER"),
> u=node:NODE("OBJECTTYPE:USER")
> MATCH n<-[r:FOLLOWS|KNOWS]-u
> WITH n.UUID AS UUID,r.name AS RELATION,count(*) AS TOTAL,collect(DISTINCT
> u.UUID) AS ALL
> RETURN UUID,RELATION,TOTAL,"7" IN ALL AS EXIST
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.