Re: [TinkerPop] find path query takes too long when using timeLimit

166 views
Skip to first unread message
Message has been deleted

Jean-Baptiste Musso

unread,
Nov 29, 2017, 6:30:28 AM11/29/17
to gremli...@googlegroups.com
Try passing a value to the .timeLimit() step, in milliseconds:

g.V(1).repeat(timeLimit(1000).bothE().otherV().simplePath()).until(hasId(5)).path()

However, the following query should "finish" (= it should not timeout), especially if a vertex with the id 5 exists (loop exit condition):

g.V(1).repeat(bothE().otherV().simplePath()).until(hasId(5)).path()

Be aware though that what appear to be very simple traversals can quickly become *very* time-consuming, even on small graphs. See: https://www.datastax.com/2017/03/graphoendodonticology

Jean-Baptiste

On Wed, Nov 29, 2017 at 11:15 AM, אלה וייס <ellavs...@gmail.com> wrote:
 I run the following query:

g.V(1).repeat(timeLimit().bothE().otherV().simplePath()).until(hasId(5)). path.()


The broblem is it always runs 120000 miil seconds

I would like it to finish when query ends


Please help

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/7ae8e16a-707c-482f-b3ae-ffae1c08f406%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

אלה וייס

unread,
Nov 29, 2017, 7:31:09 AM11/29/17
to Gremlin-users
  I did 
g.V(1).repeat(timeLimit(120000).bothE().otherV().simplePath()).until(hasId(5)).
path.()


It always runs 120000 miil seconds , even when the quey takes 5000 milli seconds

בתאריך יום רביעי, 29 בנובמבר 2017 בשעה 13:30:28 UTC+2, מאת Jean-Baptiste Musso:
Try passing a value to the .timeLimit() step, in milliseconds:

g.V(1).repeat(timeLimit(1000).bothE().otherV().simplePath()).until(hasId(5)).path()

However, the following query should "finish" (= it should not timeout), especially if a vertex with the id 5 exists (loop exit condition):

g.V(1).repeat(bothE().otherV().simplePath()).until(hasId(5)).path()

Be aware though that what appear to be very simple traversals can quickly become *very* time-consuming, even on small graphs. See: https://www.datastax.com/2017/03/graphoendodonticology

Jean-Baptiste

On Wed, Nov 29, 2017 at 11:15 AM, אלה וייס <ellavs...@gmail.com> wrote:
 I run the following query:

g.V(1).repeat(timeLimit().bothE().otherV().simplePath()).until(hasId(5)). path.()


The broblem is it always runs 120000 miil seconds

I would like it to finish when query ends


Please help

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.

Jean-Baptiste Musso

unread,
Nov 29, 2017, 10:14:09 AM11/29/17
to gremli...@googlegroups.com
Ok - I understood it differently.
I cannot reproduce this behavior on gremlinbin.com (http://gremlinbin.com/bin/view/5a1ecd2e77f6b executed pretty much instantly).

Are you positive you're not mixing your query with something else that could affect the timing? Also, which version of TinkerPop are you using?

Jean-Baptiste

To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/dfab9437-2e7e-45cc-a698-5e28e6ece611%40googlegroups.com.

Daniel Kuppitz

unread,
Nov 29, 2017, 8:57:15 PM11/29/17
to gremli...@googlegroups.com
If there are more paths, then there's no reason why the query would stop earlier. If you're only interested in the first path, add a .limit(1).

Cheers,
Daniel


To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/dfab9437-2e7e-45cc-a698-5e28e6ece611%40googlegroups.com.

אלה וייס

unread,
Nov 30, 2017, 4:01:57 AM11/30/17
to Gremlin-users

בתאריך יום חמישי, 30 בנובמבר 2017 בשעה 03:57:15 UTC+2, מאת Daniel Kuppitz:

אלה וייס

unread,
Nov 30, 2017, 4:13:35 AM11/30/17
to Gremlin-users


Hi daniel 

The timeLimit does not work ok in the find path query

Im using the latest dse 5.1.5

Im not sure what is the tinkerpop version 

I looked at the latest release documentation :

I think the tinkerpop3 version is TinkerPop 3.2.7-20170926-2e5c13b7


When I run my query with timeLimit  5000 , it runs 5000

When I run the same query with 120000 it runs 120000

 !!!It wrong

g.V(id1).repeat(timeLimit(5000).bothE().otherV().simplePath()).until(hasId(id2)).
           path.().range(0,5)            -----> runs 5000 millseconds
 
(g.V(id1).repeat(timeLimit(120000).bothE().otherV().simplePath()).until(hasId(id2)).

           path.().range(0,5)   --> runs 120000 millsecons. 
בתאריך יום חמישי, 30 בנובמבר 2017 בשעה 03:57:15 UTC+2, מאת Daniel Kuppitz:
If there are more paths, then there's no reason why the query would stop earlier. If you're only interested in the first path, add a .limit(1).

Cheers,
Daniel


אלה וייס

unread,
Nov 30, 2017, 4:15:34 AM11/30/17
to Gremlin-users


Hi 

The timeLimit does not work ok in the find path query

Im using the latest dse 5.1.5

Im not sure what is the tinkerpop version 

I looked at the latest release documentation :

I think the tinkerpop3 version is TinkerPop 3.2.7-20170926-2e5c13b7


When I run my query and timeLimit is 5000 , it runs 5000

When I run the same query with 120000 it runs 120000

It wrong

g.V(id1).repeat(timeLimit(5000).bothE().otherV().simplePath()).until(hasId(id2)).
           path.().range(0,5)            -----> runs 5000 millseconds
 
g.V(id1).repeat(timeLimit(120000).bothE().otherV().simplePath()).until(hasId(id2)).
           path.().range(0,5)   --> runs 120000 millsecons !!!!!!!!!!!!!!
בתאריך יום רביעי, 29 בנובמבר 2017 בשעה 17:14:09 UTC+2, מאת Jean-Baptiste Musso:

Jean-Baptiste

אלה וייס

unread,
Nov 30, 2017, 7:28:51 AM11/30/17
to Gremlin-users
It happened because graphLoader dse was running and all the queries became slow

בתאריך יום חמישי, 30 בנובמבר 2017 בשעה 11:15:34 UTC+2, מאת אלה וייס:
Reply all
Reply to author
Forward
0 new messages