// answer to http://stackoverflow.com/questions/42691687/neo4j-slow-selection-operation-with-huge-data MATCH (n) WITH count(*) as total WITH [_ IN range(1,10000) | toInt(rand()*total)] as ids MATCH (emp) WHERE id(emp) IN ids AND emp:Employee RETURN emp LIMIT 10;