{"action":"created","issue":{"url":"https://api.github.com/repos/openfoodfoundation/openfoodnetwork/issues/2360","repository_url":"https://api.github.com/repos/openfoodfoundation/openfoodnetwork","labels_url":"https://api.github.com/repos/openfoodfoundation/openfoodnetwork/issues/2360/labels{/name}","comments_url":"https://api.github.com/repos/openfoodfoundation/openfoodnetwork/issues/2360/comments","events_url":"https://api.github.com/repos/openfoodfoundation/openfoodnetwork/issues/2360/events","html_url":"https://github.com/openfoodfoundation/openfoodnetwork/pull/2360","id":329729950,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyOTEzNDY0","number":2360,"title":"Rewrite user stat query for improved performance of homepage","user":{"login":"oeoeaio","id":2067859,"node_id":"MDQ6VXNlcjIwNjc4NTk=","avatar_url":"https://avatars0.githubusercontent.com/u/2067859?v=4","gravatar_id":"","url":"https://api.github.com/users/oeoeaio","html_url":"https://github.com/oeoeaio","followers_url":"https://api.github.com/users/oeoeaio/followers","following_url":"https://api.github.com/users/oeoeaio/following{/other_user}","gists_url":"https://api.github.com/users/oeoeaio/gists{/gist_id}","starred_url":"https://api.github.com/users/oeoeaio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oeoeaio/subscriptions","organizations_url":"https://api.github.com/users/oeoeaio/orgs","repos_url":"https://api.github.com/users/oeoeaio/repos","events_url":"https://api.github.com/users/oeoeaio/events{/privacy}","received_events_url":"https://api.github.com/users/oeoeaio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"oeoeaio","id":2067859,"node_id":"MDQ6VXNlcjIwNjc4NTk=","avatar_url":"https://avatars0.githubusercontent.com/u/2067859?v=4","gravatar_id":"","url":"https://api.github.com/users/oeoeaio","html_url":"https://github.com/oeoeaio","followers_url":"https://api.github.com/users/oeoeaio/followers","following_url":"https://api.github.com/users/oeoeaio/following{/other_user}","gists_url":"https://api.github.com/users/oeoeaio/gists{/gist_id}","starred_url":"https://api.github.com/users/oeoeaio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oeoeaio/subscriptions","organizations_url":"https://api.github.com/users/oeoeaio/orgs","repos_url":"https://api.github.com/users/oeoeaio/repos","events_url":"https://api.github.com/users/oeoeaio/events{/privacy}","received_events_url":"https://api.github.com/users/oeoeaio/received_events","type":"User","site_admin":false},"assignees":[{"login":"oeoeaio","id":2067859,"node_id":"MDQ6VXNlcjIwNjc4NTk=","avatar_url":"https://avatars0.githubusercontent.com/u/2067859?v=4","gravatar_id":"","url":"https://api.github.com/users/oeoeaio","html_url":"https://github.com/oeoeaio","followers_url":"https://api.github.com/users/oeoeaio/followers","following_url":"https://api.github.com/users/oeoeaio/following{/other_user}","gists_url":"https://api.github.com/users/oeoeaio/gists{/gist_id}","starred_url":"https://api.github.com/users/oeoeaio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oeoeaio/subscriptions","organizations_url":"https://api.github.com/users/oeoeaio/orgs","repos_url":"https://api.github.com/users/oeoeaio/repos","events_url":"https://api.github.com/users/oeoeaio/events{/privacy}","received_events_url":"https://api.github.com/users/oeoeaio/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-06-06T06:38:38Z","updated_at":"2018-06-06T07:13:19Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/openfoodfoundation/openfoodnetwork/pulls/2360","html_url":"https://github.com/openfoodfoundation/openfoodnetwork/pull/2360","diff_url":"https://github.com/openfoodfoundation/openfoodnetwork/pull/2360.diff","patch_url":"https://github.com/openfoodfoundation/openfoodnetwork/pull/2360.patch"},"body":"#### What? Why?\r\n\r\nWe just set up Skylight and it immediately became clear that some of the lowest hanging fruit for performance improvement is the count of active shoppers on the homepage. This PR rewrites the query so that it no longer uses an unnecessary join, which should mean a ~6-8x speed improvement (according to my local testing). If we're lucky this may bring our homepage load time down to <100ms for Aus production.\r\n\r\n#### What should we test?\r\n\r\n- [ ] The `FOOD SHOPPERS` count on the homepage should continue to work, and should show the same number as it did prior to this change being made\r\n\r\n#### Release notes\r\n\r\nMade a small technical change to stat calculation to improve the load time of the homepage"},"comment":{"url":"https://api.github.com/repos/openfoodfoundation/openfoodnetwork/issues/comments/394965118","html_url":"https://github.com/openfoodfoundation/openfoodnetwork/pull/2360#issuecomment-394965118","issue_url":"https://api.github.com/repos/openfoodfoundation/openfoodnetwork/issues/2360","id":394965118,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDk2NTExOA==","user":{"login":"oeoeaio","id":2067859,"node_id":"MDQ6VXNlcjIwNjc4NTk=","avatar_url":"https://avatars0.githubusercontent.com/u/2067859?v=4","gravatar_id":"","url":"https://api.github.com/users/oeoeaio","html_url":"https://github.com/oeoeaio","followers_url":"https://api.github.com/users/oeoeaio/followers","following_url":"https://api.github.com/users/oeoeaio/following{/other_user}","gists_url":"https://api.github.com/users/oeoeaio/gists{/gist_id}","starred_url":"https://api.github.com/users/oeoeaio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oeoeaio/subscriptions","organizations_url":"https://api.github.com/users/oeoeaio/orgs","repos_url":"https://api.github.com/users/oeoeaio/repos","events_url":"https://api.github.com/users/oeoeaio/events{/privacy}","received_events_url":"https://api.github.com/users/oeoeaio/received_events","type":"User","site_admin":false},"created_at":"2018-06-06T07:13:19Z","updated_at":"2018-06-06T07:13:19Z","author_association":"CONTRIBUTOR","body":"> Don't take the results on your localhost too seriously. There are many factors at play.\r\n\r\nHaha, don't worry, I haven't got my hopes up too high.\r\n\r\n> We have also Skylight for staging to try these things out.\r\n\r\nWould be great to see the impact there to determine whether this is worth putting through. 👍 "}}
{"actor":{"display_login":"oeoeaio"}}