{"action":"created","issue":{"url":"https://api.github.com/repos/PHPAuth/PHPAuth/issues/106","labels_url":"https://api.github.com/repos/PHPAuth/PHPAuth/issues/106/labels{/name}","comments_url":"https://api.github.com/repos/PHPAuth/PHPAuth/issues/106/comments","events_url":"https://api.github.com/repos/PHPAuth/PHPAuth/issues/106/events","html_url":"https://github.com/PHPAuth/PHPAuth/issues/106","id":106538486,"number":106,"title":"Inefficent count system","user":{"login":"bugada","id":4438193,"avatar_url":"https://avatars.githubusercontent.com/u/4438193?v=3","gravatar_id":"","url":"https://api.github.com/users/bugada","html_url":"https://github.com/bugada","followers_url":"https://api.github.com/users/bugada/followers","following_url":"https://api.github.com/users/bugada/following{/other_user}","gists_url":"https://api.github.com/users/bugada/gists{/gist_id}","starred_url":"https://api.github.com/users/bugada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bugada/subscriptions","organizations_url":"https://api.github.com/users/bugada/orgs","repos_url":"https://api.github.com/users/bugada/repos","events_url":"https://api.github.com/users/bugada/events{/privacy}","received_events_url":"https://api.github.com/users/bugada/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/PHPAuth/PHPAuth/labels/accepting%20PR","name":"accepting PR","color":"5319e7"},{"url":"https://api.github.com/repos/PHPAuth/PHPAuth/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-15T11:41:38Z","updated_at":"2015-09-17T07:44:19Z","closed_at":"2015-09-17T07:44:18Z","body":"In isMailTaken() and isBlocked() the query does a 'select field from' and then $query->rowCount() instead of select count(). This is ok when we use the fetched fields, not very efficient when counting:\r\nusing count(), internally the db engine will process the request differently and will only allocate memory to store the result of the count.\r\nWhen using $query->rowCount(); the server (Apache/PHP) will process the entire result set, allocate memory for all those results, and put the server in fetching mode, which involves a lot of different details, such as locking. \r\n\r\nCan I change these queries or there is a reason for the  $query->rowCount() approach?"},"comment":{"url":"https://api.github.com/repos/PHPAuth/PHPAuth/issues/comments/140994140","html_url":"https://github.com/PHPAuth/PHPAuth/issues/106#issuecomment-140994140","issue_url":"https://api.github.com/repos/PHPAuth/PHPAuth/issues/106","id":140994140,"user":{"login":"bugada","id":4438193,"avatar_url":"https://avatars.githubusercontent.com/u/4438193?v=3","gravatar_id":"","url":"https://api.github.com/users/bugada","html_url":"https://github.com/bugada","followers_url":"https://api.github.com/users/bugada/followers","following_url":"https://api.github.com/users/bugada/following{/other_user}","gists_url":"https://api.github.com/users/bugada/gists{/gist_id}","starred_url":"https://api.github.com/users/bugada/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bugada/subscriptions","organizations_url":"https://api.github.com/users/bugada/orgs","repos_url":"https://api.github.com/users/bugada/repos","events_url":"https://api.github.com/users/bugada/events{/privacy}","received_events_url":"https://api.github.com/users/bugada/received_events","type":"User","site_admin":false},"created_at":"2015-09-17T07:44:18Z","updated_at":"2015-09-17T07:44:18Z","body":"Fixed with #111"}}