{"action":"opened","issue":{"url":"https://api.github.com/repos/Vincit/objection.js/issues/62","labels_url":"https://api.github.com/repos/Vincit/objection.js/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/Vincit/objection.js/issues/62/comments","events_url":"https://api.github.com/repos/Vincit/objection.js/issues/62/events","html_url":"https://github.com/Vincit/objection.js/issues/62","id":124752474,"number":62,"title":"QueryBuilder.range implementation","user":{"login":"Biktop","id":742501,"avatar_url":"https://avatars.githubusercontent.com/u/742501?v=3","gravatar_id":"","url":"https://api.github.com/users/Biktop","html_url":"https://github.com/Biktop","followers_url":"https://api.github.com/users/Biktop/followers","following_url":"https://api.github.com/users/Biktop/following{/other_user}","gists_url":"https://api.github.com/users/Biktop/gists{/gist_id}","starred_url":"https://api.github.com/users/Biktop/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Biktop/subscriptions","organizations_url":"https://api.github.com/users/Biktop/orgs","repos_url":"https://api.github.com/users/Biktop/repos","events_url":"https://api.github.com/users/Biktop/events{/privacy}","received_events_url":"https://api.github.com/users/Biktop/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-04T12:35:26Z","updated_at":"2016-01-04T12:35:26Z","closed_at":null,"body":"I have learnt that *QueryBuilder.range* executes two queries (first for getting result and second for total count). As far as I know it could be implemented in more effective way for Postgres and MySQL as well.\r\nIn [Stack-overflow question](http://stackoverflow.com/questions/156114/best-way-to-get-result-count-before-limit-was-applied-in-php-postgresql) is described technics for both databases.\r\n\r\nI think that at least details of *range* implementation should be mentioned in the documentation."}}