Your order by should be really fast
It uses a top n select and you only access the node-id directly which is instant

Von meinem iPhone gesendet

> Am 13.07.2015 um 16:20 schrieb matias.bu...@brinqa.com:
> 
> Yeah, that's much better. I didn't know that I could put a fulltext field in 
> the WHERE clause. Thank you so much.
> What about the ORDER BY case? Is there any tweak I can do?
> 
> Matias.
> 
>> On Tuesday, July 7, 2015 at 4:46:02 PM UTC-3, Michael Hunger wrote:
>> What you do is basically a hash join between the 650K nodes to match the 
>> single n node.
>> 
>> This is a better way, please try.
>> 
>>>       START
>>>                 n=node(6494)
>>>             MATCH n<-[:`host`]-x
>>                WHERE x.allContent =~ ".*Adobe.*"
>>> 
>>>             RETURN
>>>                 count(DISTINCT x) as count
>> 
>> which only goes over the relationships of node n and checks the nodes on the 
>> other side if they have Adobe in their "allContent" field.
>> 
>> Michael
>> 
>>> Am 07.07.2015 um 20:14 schrieb matias...@brinqa.com:
>>> 
>>> Hi, i'm using version Neo4j 1.9 version and i'm running in to several 
>>> performance issues in a db with 1M nodes.
>>> 
>>>  First problem is with fulltext indexing, for me this should be very fast 
>>> but for example this query:
>>> 
>>>              START
>>>                 n=node(6494), x=node:fulltext_index("allContent:Adobe")
>>>             MATCH n<-[r:`host`]-x
>>>             RETURN
>>>                 count(DISTINCT x) as count
>>> 
>>> is taking 497 secs the first time and 102 secs the second time, and the 
>>> count is just 32 nodes. I have aroung 650k nodes of type "x"  
>>> 
>>> Also I'm having some issues sorting that "x" type. This query:
>>> 
>>>              START
>>>                  n=node(1133)
>>>              MATCH
>>>                  n<-[r:domainType]-x
>>>              WITH DISTINCT x
>>>              RETURN ID(x) as nodeInstance
>>>              ORDER BY ID(x)
>>>                 LIMIT
>>>                     10
>>> 
>>> is taking 4 or 5 secs. If I remove the ORDER BY clause it takes 20ms.
>>> 
>>> Is there anything I'm doing wrong. What can I do to improve them?
>>> 
>>> Thanks,
>>> Matias.
>>> 
>>> 
>>> 
>>> -- 
>>> 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 neo4j+un...@googlegroups.com.
>>> 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 neo4j+unsubscr...@googlegroups.com.
> 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 neo4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to