Hi, after publishing this 
graphgist http://gist.neo4j.org/?05d92f567adbe971afc5 , Michael suggested 
to change the pattern and providing a profile.

This is the result:

The query is

{
  "query" : "match 
(j:jurt)-[:HAS_TERM]->()-[:BT*0..]->(t:term)-[:BT*0..1]->(t2:term 
{name:{termname}}) return t.name, count(distinct j) as count order by count 
desc limit 10",
"params":
{"termname" : "Eurovoc"}
} 


and mydomain:7474/db/data/cypher?profile=true returns after 15 secs  (the 
pattern with (j:jurt)-[:HAS_TERM|BT*0..]->(t:term)  took 20 sec)

{
    "columns": [
        "t.name",
        "count"
    ],
    "data": [
        [
            "Eurovoc",
            9576
        ],
        [
            "gezondheidsbeleid",
            1823
        ],
        [
            "overtreding",
            1393
        ],
        [
            "Europese organisatie",
            1389
        ],
        [
            "EU-instantie",
            1323
        ],
        [
            "mondiale organisatie",
            1277
        ],
        [
            "gespecialiseerde instelling van de VN",
            1143
        ],
        [
            "handeling van de EU",
            1129
        ],
        [
            "internationaal publiekrecht",
            1091
        ],
        [
            "sociaal beleid",
            971
        ]
    ],
    "plan": {
        "args": {
            "returnItemNames": [
                "t.name",
                "count"
            ],
            "_rows": 10,
            "_db_hits": 0,
            "symKeys": [
                "t.name",
                "  INTERNAL_AGGREGATE8f87b8f0-a925-43fd-aa9b-2319f9efee52"
            ]
        },
        "dbHits": 0,
        "name": "ColumnFilter",
        "children": [
            {
                "args": {
                    "limit": "Literal(10)",
                    "orderBy": [
                        "SortItem(Cached( 
 INTERNAL_AGGREGATE8f87b8f0-a925-43fd-aa9b-2319f9efee52 of type 
Integer),false)"
                    ],
                    "_rows": 10,
                    "_db_hits": 0
                },
                "dbHits": 0,
                "name": "Top",
                "children": [
                    {
                        "args": {
                            "keys": [
                                "Cached(t.name of type Any)"
                            ],
                            "_rows": 5276,
                            "aggregates": [
                                "( 
 INTERNAL_AGGREGATE8f87b8f0-a925-43fd-aa9b-2319f9efee52,Distinct(Count(j),j))"
                            ],
                            "_db_hits": 0
                        },
                        "dbHits": 0,
                        "name": "EagerAggregation",
                        "children": [
                            {
                                "args": {
                                    "_rows": 877826,
                                    "_db_hits": 877826,
                                    "exprKeys": [
                                        "t.name"
                                    ],
                                    "symKeys": [
                                        "  UNNAMED30",
                                        "j",
                                        "t",
                                        "  UNNAMED14",
                                        "  UNNAMED50",
                                        "t2",
                                        "  UNNAMED29"
                                    ]
                                },
                                "dbHits": 877826,
                                "name": "Extract",
                                "children": [
                                    {
                                        "args": {
                                            "_rows": 877826,
                                            "_db_hits": 0,
                                            "pred": "hasLabel(j:jurt(1))"
                                        },
                                        "dbHits": 0,
                                        "name": "Filter",
                                        "children": [
                                            {
                                                "args": {
                                                    "g": "(j)-[' 
 UNNAMED14']-(  UNNAMED29),(  UNNAMED29)-['  UNNAMED30']-(t)",
                                                    "_rows": 877826,
                                                    "_db_hits": 877850
                                                },
                                                "dbHits": 877850,
                                                "name": "PatternMatcher",
                                                "children": [
                                                    {
                                                        "args": {
                                                            "_rows": 8466,
                                                            "_db_hits": 0,
                                                            "pred": 
"(hasLabel(t:term(0)) AND hasLabel(t:term(0)))"
                                                        },
                                                        "dbHits": 0,
                                                        "name": "Filter",
                                                        "children": [
                                                            {
                                                                "args": {
                                                                    
"start": {
                                                                        
"identifiers": [
                                                                            
"t2"
                                                                        ],
                                                                        
"query": "{termname}",
                                                                        
"producer": "SchemaIndex",
                                                                        
"property": "name",
                                                                        
"label": "term"
                                                                    },
                                                                    
"trail": "(t2)<-[:BT*0..1]-(t)",
                                                                    
"_rows": 8466,
                                                                    
"_db_hits": 8465
                                                                },
                                                                "dbHits": 
8465,
                                                                "name": 
"TraversalMatcher",
                                                                "children": 
[],
                                                                "rows": 8466
                                                            }
                                                        ],
                                                        "rows": 8466
                                                    }
                                                ],
                                                "rows": 877826
                                            }
                                        ],
                                        "rows": 877826
                                    }
                                ],
                                "rows": 877826
                            }
                        ],
                        "rows": 5276
                    }
                ],
                "rows": 10
            }
        ],
        "rows": 10
    }
}




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