{"action":"created","issue":{"url":"https://api.github.com/repos/dimitrydhondt/sri4node/issues/78","labels_url":"https://api.github.com/repos/dimitrydhondt/sri4node/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/dimitrydhondt/sri4node/issues/78/comments","events_url":"https://api.github.com/repos/dimitrydhondt/sri4node/issues/78/events","html_url":"https://github.com/dimitrydhondt/sri4node/issues/78","id":114656497,"number":78,"title":"[Performance improvement] - Slow count","user":{"login":"rodrigouroz","id":384037,"avatar_url":"https://avatars.githubusercontent.com/u/384037?v=3","gravatar_id":"","url":"https://api.github.com/users/rodrigouroz","html_url":"https://github.com/rodrigouroz","followers_url":"https://api.github.com/users/rodrigouroz/followers","following_url":"https://api.github.com/users/rodrigouroz/following{/other_user}","gists_url":"https://api.github.com/users/rodrigouroz/gists{/gist_id}","starred_url":"https://api.github.com/users/rodrigouroz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodrigouroz/subscriptions","organizations_url":"https://api.github.com/users/rodrigouroz/orgs","repos_url":"https://api.github.com/users/rodrigouroz/repos","events_url":"https://api.github.com/users/rodrigouroz/events{/privacy}","received_events_url":"https://api.github.com/users/rodrigouroz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dimitrydhondt/sri4node/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"rodrigouroz","id":384037,"avatar_url":"https://avatars.githubusercontent.com/u/384037?v=3","gravatar_id":"","url":"https://api.github.com/users/rodrigouroz","html_url":"https://github.com/rodrigouroz","followers_url":"https://api.github.com/users/rodrigouroz/followers","following_url":"https://api.github.com/users/rodrigouroz/following{/other_user}","gists_url":"https://api.github.com/users/rodrigouroz/gists{/gist_id}","starred_url":"https://api.github.com/users/rodrigouroz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodrigouroz/subscriptions","organizations_url":"https://api.github.com/users/rodrigouroz/orgs","repos_url":"https://api.github.com/users/rodrigouroz/repos","events_url":"https://api.github.com/users/rodrigouroz/events{/privacy}","received_events_url":"https://api.github.com/users/rodrigouroz/received_events","type":"User","site_admin":false},"milestone":null,"comments":8,"created_at":"2015-11-02T18:30:19Z","updated_at":"2015-11-24T21:38:57Z","closed_at":null,"body":"Postgresql suffers from a slow performance on count queries: https://wiki.postgresql.org/wiki/Slow_Counting\r\n\r\nEach list query performs a count on the table for the meta information of the result.\r\n\r\nSince the resource is controlled by sri4node (changes to the resource are handled by it), we could cache the result of the count and avoid an extra query for each list query, only issuing a new count when a modification to the resource is done (any PUT invalidates the count)."},"comment":{"url":"https://api.github.com/repos/dimitrydhondt/sri4node/issues/comments/159412897","html_url":"https://github.com/dimitrydhondt/sri4node/issues/78#issuecomment-159412897","issue_url":"https://api.github.com/repos/dimitrydhondt/sri4node/issues/78","id":159412897,"user":{"login":"rodrigouroz","id":384037,"avatar_url":"https://avatars.githubusercontent.com/u/384037?v=3","gravatar_id":"","url":"https://api.github.com/users/rodrigouroz","html_url":"https://github.com/rodrigouroz","followers_url":"https://api.github.com/users/rodrigouroz/followers","following_url":"https://api.github.com/users/rodrigouroz/following{/other_user}","gists_url":"https://api.github.com/users/rodrigouroz/gists{/gist_id}","starred_url":"https://api.github.com/users/rodrigouroz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rodrigouroz/subscriptions","organizations_url":"https://api.github.com/users/rodrigouroz/orgs","repos_url":"https://api.github.com/users/rodrigouroz/repos","events_url":"https://api.github.com/users/rodrigouroz/events{/privacy}","received_events_url":"https://api.github.com/users/rodrigouroz/received_events","type":"User","site_admin":false},"created_at":"2015-11-24T21:38:57Z","updated_at":"2015-11-24T21:38:57Z","body":"Cool, I'll improve it as soon as I have some time. I love the idea of saving an extra query on each request."}}