Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Graph: improvement on traversal based on use case #1807

lvca opened this Issue · 1 comment

2 participants


It would be interesting creating a graph based on how you cross it.


Let the user to select if want linkset (default) or linklist. This is needed in use cases where doesn't matter to retrieve an element or when doesn't matter if you've duplicates but, rather, it's important the order of traversal. Let's think to the following graph:

V[User@name:string] --E[Downloaded@on:datetime]--> V[File@name:string]

If the graph is crossed to retrieve the last 20 users that downloaded the file, It would be:

select from (
 select expand( in('Downloaded', 20, desc ) ) from File where name = ''
) limit 20 order by on desc

But if the file has been downloaded 1M of times this is very inefficient because now linkset are always used and there is no way to determine the traversing order and/or limit.

Improved syntax

Here the idea to use LINKLIST (on explicit request) and new limit and order on traversal functions. The query above would become something like this:

select expand( in('Downloaded', 20, desc ) ) from File where name = ''

Cool! Only the first 20 items would be fetched on descending order. This is much faster than the query above if you've many edges.

@lvca lvca modified the milestone: 2.0rc1, 2.1
@lvca lvca modified the milestone: 2.2, 2.1
@luigidellaquila luigidellaquila was assigned by lvca

does it really make sense if we implement vertex-centric or edge-based indexes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.