{"action":"created","issue":{"url":"https://api.github.com/repos/neo4j/neo4j/issues/6584","repository_url":"https://api.github.com/repos/neo4j/neo4j","labels_url":"https://api.github.com/repos/neo4j/neo4j/issues/6584/labels{/name}","comments_url":"https://api.github.com/repos/neo4j/neo4j/issues/6584/comments","events_url":"https://api.github.com/repos/neo4j/neo4j/issues/6584/events","html_url":"https://github.com/neo4j/neo4j/issues/6584","id":138036604,"number":6584,"title":"Feature request: Use indexes for ORDER BY","user":{"login":"rationalism","id":813306,"avatar_url":"https://avatars.githubusercontent.com/u/813306?v=3","gravatar_id":"","url":"https://api.github.com/users/rationalism","html_url":"https://github.com/rationalism","followers_url":"https://api.github.com/users/rationalism/followers","following_url":"https://api.github.com/users/rationalism/following{/other_user}","gists_url":"https://api.github.com/users/rationalism/gists{/gist_id}","starred_url":"https://api.github.com/users/rationalism/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rationalism/subscriptions","organizations_url":"https://api.github.com/users/rationalism/orgs","repos_url":"https://api.github.com/users/rationalism/repos","events_url":"https://api.github.com/users/rationalism/events{/privacy}","received_events_url":"https://api.github.com/users/rationalism/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/neo4j/neo4j/labels/cypher","name":"cypher","color":"009800"},{"url":"https://api.github.com/repos/neo4j/neo4j/labels/enhancement","name":"enhancement","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":16,"created_at":"2016-03-03T00:36:40Z","updated_at":"2016-09-06T21:28:06Z","closed_at":null,"body":"Currently (in neo4j 2.3.2), this Cypher:\r\n\r\nPROFILE MATCH (n:person) RETURN n.email ORDER BY n.email LIMIT 1\r\n\r\nstarts off with an O(N) NodeByLabelScan, while this Cypher:\r\n\r\nPROFILE MATCH (n:person) WHERE n.email < \"aaaaaaa@gmail.com\" RETURN n.email LIMIT 1\r\n\r\nstarts with a NodeUniqueIndexSeekByRange (if person:email is indexed), which is much faster for large graphs. I can sort of work around this by saying WHERE n.email < x and then doing binary search on x, but that's clunky and slow. Can ORDER BY be updated to use indexes in 3.0? Thanks.\r\n\r\nRelevant StackOverflow thread: http://stackoverflow.com/questions/23835349/does-cyphers-order-by-uses-the-index"},"comment":{"url":"https://api.github.com/repos/neo4j/neo4j/issues/comments/245099896","html_url":"https://github.com/neo4j/neo4j/issues/6584#issuecomment-245099896","issue_url":"https://api.github.com/repos/neo4j/neo4j/issues/6584","id":245099896,"user":{"login":"jexp","id":67427,"avatar_url":"https://avatars.githubusercontent.com/u/67427?v=3","gravatar_id":"","url":"https://api.github.com/users/jexp","html_url":"https://github.com/jexp","followers_url":"https://api.github.com/users/jexp/followers","following_url":"https://api.github.com/users/jexp/following{/other_user}","gists_url":"https://api.github.com/users/jexp/gists{/gist_id}","starred_url":"https://api.github.com/users/jexp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jexp/subscriptions","organizations_url":"https://api.github.com/users/jexp/orgs","repos_url":"https://api.github.com/users/jexp/repos","events_url":"https://api.github.com/users/jexp/events{/privacy}","received_events_url":"https://api.github.com/users/jexp/received_events","type":"User","site_admin":false},"created_at":"2016-09-06T21:28:06Z","updated_at":"2016-09-06T21:28:06Z","body":"You can use APOC for that for the time being, check out:\r\n\r\nhttps://neo4j-contrib.github.io/neo4j-apoc-procedures/#_schema_index_queries"}}
{"actor":{"display_login":"jexp"}}