{"action":"created","issue":{"url":"https://api.github.com/repos/ScienceCommons/api/issues/153","labels_url":"https://api.github.com/repos/ScienceCommons/api/issues/153/labels{/name}","comments_url":"https://api.github.com/repos/ScienceCommons/api/issues/153/comments","events_url":"https://api.github.com/repos/ScienceCommons/api/issues/153/events","html_url":"https://github.com/ScienceCommons/api/issues/153","id":67955631,"number":153,"title":"Overly slow loading times for article lists on home page and search results page","user":{"login":"eplebel","id":4512335,"avatar_url":"https://avatars.githubusercontent.com/u/4512335?v=3","gravatar_id":"","url":"https://api.github.com/users/eplebel","html_url":"https://github.com/eplebel","followers_url":"https://api.github.com/users/eplebel/followers","following_url":"https://api.github.com/users/eplebel/following{/other_user}","gists_url":"https://api.github.com/users/eplebel/gists{/gist_id}","starred_url":"https://api.github.com/users/eplebel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eplebel/subscriptions","organizations_url":"https://api.github.com/users/eplebel/orgs","repos_url":"https://api.github.com/users/eplebel/repos","events_url":"https://api.github.com/users/eplebel/events{/privacy}","received_events_url":"https://api.github.com/users/eplebel/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ScienceCommons/api/labels/elance%20contract%20%231","name":"elance contract #1","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-12T20:39:24Z","updated_at":"2015-04-26T02:53:21Z","closed_at":null,"body":"It takes about 3 seconds to load the lists of \"Recently Added\" and \"Recently Updated\" articles on the homepage and about 2 seconds to display lists of articles on search results page. This didn't used to be the case; it started happening sometime in late November 2014 (in case this helps identify the problem).\r\n\r\nThis is perhaps related to open issue #94 (HTTP keep-alive doesn't seem to be working ), given that load times do seem quicker if you keep repeating the action. For example, if you quickly re-do a search \"Bargh warmth\", it only takes about 1 seconds instead of 2 seconds (whereby a ~1 second load time being acceptable for a beta version of the app)."},"comment":{"url":"https://api.github.com/repos/ScienceCommons/api/issues/comments/96313370","html_url":"https://github.com/ScienceCommons/api/issues/153#issuecomment-96313370","issue_url":"https://api.github.com/repos/ScienceCommons/api/issues/153","id":96313370,"user":{"login":"alexkyllo","id":2609312,"avatar_url":"https://avatars.githubusercontent.com/u/2609312?v=3","gravatar_id":"","url":"https://api.github.com/users/alexkyllo","html_url":"https://github.com/alexkyllo","followers_url":"https://api.github.com/users/alexkyllo/followers","following_url":"https://api.github.com/users/alexkyllo/following{/other_user}","gists_url":"https://api.github.com/users/alexkyllo/gists{/gist_id}","starred_url":"https://api.github.com/users/alexkyllo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexkyllo/subscriptions","organizations_url":"https://api.github.com/users/alexkyllo/orgs","repos_url":"https://api.github.com/users/alexkyllo/repos","events_url":"https://api.github.com/users/alexkyllo/events{/privacy}","received_events_url":"https://api.github.com/users/alexkyllo/received_events","type":"User","site_admin":false},"created_at":"2015-04-26T02:53:21Z","updated_at":"2015-04-26T02:53:21Z","body":"I believe the slow loading times are due to table scans on the Article table. The landing page shows the 5 recently created and 5 most recently updated articles, and it has to query all 288,330 articles and sort them in order to do this. Adding indexes on created_at and updated_at columns should fix this.\r\n\r\n![screen shot 2015-04-23 at 8 04 20 pm](https://cloud.githubusercontent.com/assets/2609312/7335688/16930654-eb84-11e4-9012-4c33a81e0371.png)\r\n"}}