Skip to content

Instantly share code, notes, and snippets.

@systay
Created October 15, 2014 06:42
Show Gist options
  • Save systay/ef5e868f1882edab4988 to your computer and use it in GitHub Desktop.
Save systay/ef5e868f1882edab4988 to your computer and use it in GitHub Desktop.
neo4j-sh (?)$ profile cypher 2.1
> MATCH p = (n:Topic)-[*0..2]-(m:Topic)
> where n.name = 'Topic1' and m.name = 'Topic2'
> return p, reduce(totProximity = 0, n IN relationships(p)| totProximity + n.proximity) AS pathProximity
> order by pathProximity DESC LIMIT 6;
+-------------------+
| p | pathProximity |
+-------------------+
+-------------------+
0 row
74 ms
Compiler CYPHER 2.1
ColumnFilter
|
+Top
|
+Extract
|
+ExtractPath
|
+Filter
|
+TraversalMatcher
+------------------+------+--------+-------------+-------------------------------------------------------------------------------------------------------+
| Operator | Rows | DbHits | Identifiers | Other |
+------------------+------+--------+-------------+-------------------------------------------------------------------------------------------------------+
| ColumnFilter | 0 | 0 | | keep columns p, pathProximity |
| Top | 0 | 0 | | { AUTOINT3}; Cached(pathProximity of type Any) |
| Extract | 0 | 0 | | pathProximity |
| ExtractPath | 0 | 0 | p | |
| Filter | 0 | 0 | | ((hasLabel(m:Topic) AND Property(n,name) == { AUTOSTRING0}) AND Property(m,name) == { AUTOSTRING1}) |
| TraversalMatcher | 0 | 1 | | m, UNNAMED20, m |
+------------------+------+--------+-------------+-------------------------------------------------------------------------------------------------------+
Total database accesses: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment