[Neo4j] Neo4j Community Memory Usage

2016-06-25 Thread Marcus Baffa
Hi,

I am working with Neo4j Community and my application is inserting something 
like 10 nodes per second. It is working ok but the memory usage is always 
going up.

How can I configure it to stop the memory usage from growing and use, for 
instance, the swap files ?

Thanks

-- 
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.


[Neo4j] Add and edit nodes in visual mode

2016-06-25 Thread Александр Присмотров
Hello! Can I add and edit nodes in visual mode? Did not find such 
opportunity.

-- 
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.


[Neo4j] Is Cypher-3.0 queries are slower than Traversal API or Procedures !!

2016-06-25 Thread Gurpreet Singh
Guys,

i am working on Neo4j-3.0 enterprise database, i have 1 billion around data 
which is connected each other.
Right now, i am using Cypher-3.0 queries to search friends upto 3rd level 
depth and i have seen that its taking lot of time like 1/2 minutes or more 
than that. i have already optimised query at various level like indexes 
etc. but not getting significant performance. I am expecting results in 
milliseconds but response time is very bad.

Here is query:
*MATCH 
p=(c:contact_info{phoneNumber:'56276736'})-[r:knows*1..3]->(d:contact_info) *
*WHERE d.phoneNumber <> '56276736' and LOWER(d.fullname) CONTAINS 'sin'*
*WITH LAST(NODES(p)) as d,LENGTH(p) as deg order by deg*
*RETURN 
d.firstname,d.lastname,d.phoneNumber,d.spamScore,HEAD(COLLECT(DISTINCT 
deg)) as deg order by deg;*


Suggest me, Shall i move to Traversal API or Procedures ???, if it is right 
then how much faster it is?


-- 
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.


Re: [Neo4j] Optimizing ShortestPath query for a better performances

2016-06-25 Thread 'Michael Hunger' via Neo4j
On Sat, Jun 25, 2016 at 10:23 PM, idor  wrote:

> Hi Michael,
> Thanks for replying.
>
> scale it out on a scluster.
>
>
> It requiresNeo4j entreprise license isnt it?
>

It will require neo4j enterprise. Which license depends on your use-case
and company.


>
> Why do you string-concatinate the dist property?
>>
>
> On each relation we have a numeric property that we want to aggregate
> later on. if A connected to D this way (A->B->C>D) we need the properties
> of each relation between two nodes within 3  hops (A->B,B->C,C->D).
>
> The expected result would be:
> B,C,D and the relation between.
>

I don't understand what you're saying.

>
>
> But you also know that this can potentially return a lot of data? e.g. of
>> you have 100 friends on average this returns 100^3 aka 1M results !
>
>
> The max "friends" of each node will be ~10. not more.
>
> for what you do shortest Path is not the right solution
>
>
> How this query will overcome ciruclar iterations ? let's assume following
> relation ships..
>

Each relationship will appear only once in a path. So no circles.

If you mean that there are multiple paths between your start node and it's
3rd degree neighbors, sure that can happen.

You, could either aggregate on the end node and select one of the paths.

In APOC procedures there is expandPath operation
which
allows you to define the uniqueness of nodes and relationships. There you
could define node-global as uniqueness.



>
> A->B
> B->C->D
> B->F->D
> B->H->D
> ...
> now if I apply it on node A. expected results is (B,C,D,F,H). but as u can
> see there are many *paths* to get into D. I might have lots of paths
> between one source to another(within 3 hops) till I iterate on all relevant
> nodes.
> Wouldnt you query fall for this with performances?
>
> Thanks.
>
>
>
>
>
> On Saturday, June 25, 2016 at 10:46:37 PM UTC+3, Michael Hunger wrote:
>>
>> Hi,
>>
>> for what you do shortest Path is not the right solution, as you don't wan
>> the path between two nodes but the neighborhood of one node.
>>
>> Also having that many connections when you don't have the CPUs to process
>> it doesn't make sense, scale it out on a scluster.
>>
>> Why do you string-concatinate the dist property?
>>
>> I presume you have an index / constraint on :User(userId) ?
>>
>> Try this instead:
>>
>>
>> MATCH (user:User{userId:})
>>  MATCH
>> p=(user)-[r:relation_type1|relation_type2|relation_3*1..3]-(friend:User)
>> WHERE friend <> user
>> RETURN friend.userId as userId, reduce(base = '', rel in r |
>> base + ' ' + rel.dist) as dist
>>
>> But you also know that this can potentially return a lot of data? e.g. of
>> you have 100 friends on average this returns 100^3 aka 1M results !
>>
>> Michael
>>
>>
>> On Sat, Jun 25, 2016 at 10:36 AM, idor  wrote:
>>
>>> I have in my graph ~1M nodes and ~1M relations.
>>>
>>> My motivation for query is to retrieve all related nodes(by 3 hops) of
>>> specific source node + aggregate properties within the response.
>>>
>>> I understood the shortestPath taking your sourceNode and query all other
>>> nodes(not necessarily related ones) in the graph to match the relevant
>>> results.
>>> My latency is around 2-4 seconds when I have load (~4000 concurrent
>>> connections). it's too high.
>>>
>>> Any idea how could I optimize my query for better performances?
>>>
>>>
>>>  MATCH
>>> p=shortestPath((user:User{userId:})-[r:relation_type1|relation_type2|relation_3*1..3]-(user:User))
>>> WHERE f <> user
>>> RETURN (f.userId) as userId,
>>> reduce(base = '', rel in r | base + ' ' + rel.dist) as dist
>>>
>>>
>>> * notes: userId and relation_type1/2/3 are auto indexed
>>>
>>> * I am using the rest client and recently thought to upgrade into the
>>> new BOLT driver(not sure it will helps)
>>>
>>> Thank you.
>>>
>>>
>>> --
>>> 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.


Re: [Neo4j] Optimizing ShortestPath query for a better performances

2016-06-25 Thread idor
Hi Michael,
Thanks for replying. 

scale it out on a scluster.


It requiresNeo4j entreprise license isnt it? 

Why do you string-concatinate the dist property?
>

On each relation we have a numeric property that we want to aggregate later 
on. if A connected to D this way (A->B->C>D) we need the properties of each 
relation between two nodes within 3  hops (A->B,B->C,C->D).

The expected result would be:
B,C,D and the relation between. 


But you also know that this can potentially return a lot of data? e.g. of 
> you have 100 friends on average this returns 100^3 aka 1M results !


The max "friends" of each node will be ~10. not more. 

for what you do shortest Path is not the right solution

 
How this query will overcome ciruclar iterations ? let's assume following 
relation ships.. 

A->B
B->C->D 
B->F->D
B->H->D
...
now if I apply it on node A. expected results is (B,C,D,F,H). but as u can 
see there are many *paths* to get into D. I might have lots of paths 
between one source to another(within 3 hops) till I iterate on all relevant 
nodes. 
Wouldnt you query fall for this with performances?

Thanks.





On Saturday, June 25, 2016 at 10:46:37 PM UTC+3, Michael Hunger wrote:
>
> Hi,
>
> for what you do shortest Path is not the right solution, as you don't wan 
> the path between two nodes but the neighborhood of one node.
>
> Also having that many connections when you don't have the CPUs to process 
> it doesn't make sense, scale it out on a scluster.
>
> Why do you string-concatinate the dist property?
>
> I presume you have an index / constraint on :User(userId) ?
>
> Try this instead:
>
>
> MATCH (user:User{userId:})
>  MATCH 
> p=(user)-[r:relation_type1|relation_type2|relation_3*1..3]-(friend:User)
> WHERE friend <> user 
> RETURN friend.userId as userId, reduce(base = '', rel in r | base 
> + ' ' + rel.dist) as dist 
>
> But you also know that this can potentially return a lot of data? e.g. of 
> you have 100 friends on average this returns 100^3 aka 1M results !
>
> Michael
>
>
> On Sat, Jun 25, 2016 at 10:36 AM, idor  
> wrote:
>
>> I have in my graph ~1M nodes and ~1M relations.
>>
>> My motivation for query is to retrieve all related nodes(by 3 hops) of 
>> specific source node + aggregate properties within the response.
>>
>> I understood the shortestPath taking your sourceNode and query all other 
>> nodes(not necessarily related ones) in the graph to match the relevant 
>> results.
>> My latency is around 2-4 seconds when I have load (~4000 concurrent 
>> connections). it's too high. 
>>
>> Any idea how could I optimize my query for better performances?
>>
>>
>>  MATCH 
>> p=shortestPath((user:User{userId:})-[r:relation_type1|relation_type2|relation_3*1..3]-(user:User))
>> WHERE f <> user 
>> RETURN (f.userId) as userId,
>> reduce(base = '', rel in r | base + ' ' + rel.dist) as dist 
>>
>>
>> * notes: userId and relation_type1/2/3 are auto indexed
>>
>> * I am using the rest client and recently thought to upgrade into the new 
>> BOLT driver(not sure it will helps)
>>
>> Thank you.
>>
>>
>> -- 
>> 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.


Re: [Neo4j] Optimizing ShortestPath query for a better performances

2016-06-25 Thread 'Michael Hunger' via Neo4j
Hi,

for what you do shortest Path is not the right solution, as you don't wan
the path between two nodes but the neighborhood of one node.

Also having that many connections when you don't have the CPUs to process
it doesn't make sense, scale it out on a scluster.

Why do you string-concatinate the dist property?

I presume you have an index / constraint on :User(userId) ?

Try this instead:


MATCH (user:User{userId:})
 MATCH
p=(user)-[r:relation_type1|relation_type2|relation_3*1..3]-(friend:User)
WHERE friend <> user
RETURN friend.userId as userId, reduce(base = '', rel in r | base +
' ' + rel.dist) as dist

But you also know that this can potentially return a lot of data? e.g. of
you have 100 friends on average this returns 100^3 aka 1M results !

Michael


On Sat, Jun 25, 2016 at 10:36 AM, idor  wrote:

> I have in my graph ~1M nodes and ~1M relations.
>
> My motivation for query is to retrieve all related nodes(by 3 hops) of
> specific source node + aggregate properties within the response.
>
> I understood the shortestPath taking your sourceNode and query all other
> nodes(not necessarily related ones) in the graph to match the relevant
> results.
> My latency is around 2-4 seconds when I have load (~4000 concurrent
> connections). it's too high.
>
> Any idea how could I optimize my query for better performances?
>
>
>  MATCH
> p=shortestPath((user:User{userId:})-[r:relation_type1|relation_type2|relation_3*1..3]-(user:User))
> WHERE f <> user
> RETURN (f.userId) as userId,
> reduce(base = '', rel in r | base + ' ' + rel.dist) as dist
>
>
> * notes: userId and relation_type1/2/3 are auto indexed
>
> * I am using the rest client and recently thought to upgrade into the new
> BOLT driver(not sure it will helps)
>
> Thank you.
>
>
> --
> 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.


[Neo4j] Optimizing ShortestPath query for a better performances

2016-06-25 Thread idor
I have in my graph ~1M nodes and ~1M relations.

My motivation for query is to retrieve all related nodes(by 3 hops) of 
specific source node + aggregate properties within the response.

I understood the shortestPath taking your sourceNode and query all other 
nodes(not necessarily related ones) in the graph to match the relevant 
results.
My latency is around 2-4 seconds when I have load (~4000 concurrent 
connections). it's too high. 

Any idea how could I optimize my query for better performances?


 MATCH 
p=shortestPath((user:User{userId:})-[r:relation_type1|relation_type2|relation_3*1..3]-(user:User))
WHERE f <> user 
RETURN (f.userId) as userId,
reduce(base = '', rel in r | base + ' ' + rel.dist) as dist 


* notes: userId and relation_type1/2/3 are auto indexed

* I am using the rest client and recently thought to upgrade into the new 
BOLT driver(not sure it will helps)

Thank you.


-- 
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.