{"action":"created","issue":{"url":"https://api.github.com/repos/impactlab/oeem-energy-datastore/issues/32","repository_url":"https://api.github.com/repos/impactlab/oeem-energy-datastore","labels_url":"https://api.github.com/repos/impactlab/oeem-energy-datastore/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/impactlab/oeem-energy-datastore/issues/32/comments","events_url":"https://api.github.com/repos/impactlab/oeem-energy-datastore/issues/32/events","html_url":"https://github.com/impactlab/oeem-energy-datastore/pull/32","id":143346568,"number":32,"title":"WIP: Speed up API queries","user":{"login":"evz","id":551491,"avatar_url":"https://avatars.githubusercontent.com/u/551491?v=3","gravatar_id":"","url":"https://api.github.com/users/evz","html_url":"https://github.com/evz","followers_url":"https://api.github.com/users/evz/followers","following_url":"https://api.github.com/users/evz/following{/other_user}","gists_url":"https://api.github.com/users/evz/gists{/gist_id}","starred_url":"https://api.github.com/users/evz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evz/subscriptions","organizations_url":"https://api.github.com/users/evz/orgs","repos_url":"https://api.github.com/users/evz/repos","events_url":"https://api.github.com/users/evz/events{/privacy}","received_events_url":"https://api.github.com/users/evz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/impactlab/oeem-energy-datastore/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-24T20:06:35Z","updated_at":"2016-03-25T14:11:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/impactlab/oeem-energy-datastore/pulls/32","html_url":"https://github.com/impactlab/oeem-energy-datastore/pull/32","diff_url":"https://github.com/impactlab/oeem-energy-datastore/pull/32.diff","patch_url":"https://github.com/impactlab/oeem-energy-datastore/pull/32.patch"},"body":"This is a stab at speeding up the queries needed to return results from the project API end points. One major caveat as the code is written right now is that the SQL I have in there is PostgreSQL specific. We can probably make it more generic but I just wanted to place this flag in the ground and see if this seems like an approach that we're into.\r\n\r\nOne major improvement is that the number of queries to return projects with attributes and meterruns is down to 8 all the time (no matter how many projects you want) and tends to return results within about 2 or 3 seconds when you're requesting everything."},"comment":{"url":"https://api.github.com/repos/impactlab/oeem-energy-datastore/issues/comments/201297928","html_url":"https://github.com/impactlab/oeem-energy-datastore/pull/32#issuecomment-201297928","issue_url":"https://api.github.com/repos/impactlab/oeem-energy-datastore/issues/32","id":201297928,"user":{"login":"evz","id":551491,"avatar_url":"https://avatars.githubusercontent.com/u/551491?v=3","gravatar_id":"","url":"https://api.github.com/users/evz","html_url":"https://github.com/evz","followers_url":"https://api.github.com/users/evz/followers","following_url":"https://api.github.com/users/evz/following{/other_user}","gists_url":"https://api.github.com/users/evz/gists{/gist_id}","starred_url":"https://api.github.com/users/evz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evz/subscriptions","organizations_url":"https://api.github.com/users/evz/orgs","repos_url":"https://api.github.com/users/evz/repos","events_url":"https://api.github.com/users/evz/events{/privacy}","received_events_url":"https://api.github.com/users/evz/received_events","type":"User","site_admin":false},"created_at":"2016-03-25T14:11:35Z","updated_at":"2016-03-25T14:11:35Z","body":"@philngo If you feel like this is a sane approach, I can finish this up. Looks like I'll need to figure out why those tests aren't passing, too."}}