{"action":"created","issue":{"url":"https://api.github.com/repos/yosukeh/try1/issues/95","repository_url":"https://api.github.com/repos/yosukeh/try1","labels_url":"https://api.github.com/repos/yosukeh/try1/issues/95/labels{/name}","comments_url":"https://api.github.com/repos/yosukeh/try1/issues/95/comments","events_url":"https://api.github.com/repos/yosukeh/try1/issues/95/events","html_url":"https://github.com/yosukeh/try1/issues/95","id":124763352,"number":95,"title":"レスポンス改善（Mainページのロード速度）","user":{"login":"yosukeh","id":12252854,"avatar_url":"https://avatars.githubusercontent.com/u/12252854?v=3","gravatar_id":"","url":"https://api.github.com/users/yosukeh","html_url":"https://github.com/yosukeh","followers_url":"https://api.github.com/users/yosukeh/followers","following_url":"https://api.github.com/users/yosukeh/following{/other_user}","gists_url":"https://api.github.com/users/yosukeh/gists{/gist_id}","starred_url":"https://api.github.com/users/yosukeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosukeh/subscriptions","organizations_url":"https://api.github.com/users/yosukeh/orgs","repos_url":"https://api.github.com/users/yosukeh/repos","events_url":"https://api.github.com/users/yosukeh/events{/privacy}","received_events_url":"https://api.github.com/users/yosukeh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yosukeh/try1/labels/High%20Priority","name":"High Priority","color":"fef2c0"},{"url":"https://api.github.com/repos/yosukeh/try1/labels/In%20Progress","name":"In Progress","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/yosukeh/try1/milestones/4","html_url":"https://github.com/yosukeh/try1/milestones/Phase1%E3%80%8C%E9%A0%AD%E7%97%9B%E3%83%8E%E3%83%BC%E3%83%88%E3%80%8D","labels_url":"https://api.github.com/repos/yosukeh/try1/milestones/4/labels","id":1472120,"number":4,"title":"Phase1「頭痛ノート」","description":"「頭痛ノート」の電子版として、\r\n他の人に使ってもらえる状態にする。\r\n","creator":{"login":"yosukeh","id":12252854,"avatar_url":"https://avatars.githubusercontent.com/u/12252854?v=3","gravatar_id":"","url":"https://api.github.com/users/yosukeh","html_url":"https://github.com/yosukeh","followers_url":"https://api.github.com/users/yosukeh/followers","following_url":"https://api.github.com/users/yosukeh/following{/other_user}","gists_url":"https://api.github.com/users/yosukeh/gists{/gist_id}","starred_url":"https://api.github.com/users/yosukeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosukeh/subscriptions","organizations_url":"https://api.github.com/users/yosukeh/orgs","repos_url":"https://api.github.com/users/yosukeh/repos","events_url":"https://api.github.com/users/yosukeh/events{/privacy}","received_events_url":"https://api.github.com/users/yosukeh/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":35,"state":"open","created_at":"2015-12-23T02:26:16Z","updated_at":"2016-02-14T09:15:13Z","due_on":"2016-12-04T15:00:00Z","closed_at":null},"comments":8,"created_at":"2016-01-04T13:58:27Z","updated_at":"2016-03-02T22:57:51Z","closed_at":null,"body":"◆◆◆◆　　　ロード時のDBアクセスの件（10秒中の6秒）　◆◆◆◆\r\nテストアカウント作成\r\n　・まずメインアカウントで。\r\n気になる部分の携帯電話のStockブラウザでの計測（目視） \r\n　　SQLの部分で、久々にやると3秒かかる疑惑。\r\n     DBのキャッシュを消してからやると、10秒かかった。\r\n　　JS側から見て、Restで●●6秒●●かかってる。\r\n　　　　  599 @request JSON call__getConditionData start\r\n　　　　　6491 @received JSON   getConditionData\r\n　　　→　PHP側から見て、5.8秒かかってる。\r\n　　　　　　17:26:22.769 rest_getConditionData.php <<<<\r\n　　　　　　17:26:28.437　rest_getConditionData.php >>>>\r\n　　　　　→症状リスト取得SQL発行で、4.1秒。\r\n　　　　　　　17:26:22.774　\r\n　　　　　　　17:26:26.810\r\n　　　　　→行動リスト取得SQL発行で、1.4秒。\r\n　　　　　　　17:26:26.968\r\n　　　　　　　17:26:28.344\r\n\r\n　　DBの複数回計測。\r\n　　　　①　オリジナル：\r\n　　　　　　　6234   5940   5980   6055 6230\r\n     　　②　symptom_input_count_30days、symptom_input_count　削除版：\r\n　　　　　　　5900  5900　5855\r\n    　　③　MemoをSelectから削除\r\n　　　　　　　4700   4180  4400\r\n    　　④　Memo・写真URLをSelectから削除　　◆これが効く\r\n　　　　　　　2600　2600\r\n　　　　⑤　Selectをsymptom_record.idのみに。\r\n　　　　　　　２４５０　２３００\r\n\r\n\r\nあと、日付が変わると、キャッシュがつかなくなる（30日間のソートのため）のも効いていると思う。◆\r\n      →こっちをなんとかするのが良いと考える。\r\n　　　　　・クエリキャッシュを16Mから１２８Mにかえた。\r\n　　　　　→30日のを取るのは、べつのクエリにして、PHPで、メインのクエリ結果から30日の結果を取るようにして結合し、その後PHPでソートをかける。　　\r\n　　　　　　→00:01に、CronJobで、キャッシュを作る案。　　\r\n　　　1ユーザ5秒。　4時くらいに回せば、１ｈで720人分。　。。多くはないな。。AWSに引っ越すと早くなるのだろうか。。　　\r\n\r\n　　　　　　　Cronjobやめて、メモと写真urlを別sqlでにとるようにしよう。で、それをphpで結合する。★★★こっちをやった\r\n"},"comment":{"url":"https://api.github.com/repos/yosukeh/try1/issues/comments/191481406","html_url":"https://github.com/yosukeh/try1/issues/95#issuecomment-191481406","issue_url":"https://api.github.com/repos/yosukeh/try1/issues/95","id":191481406,"user":{"login":"yosukeh","id":12252854,"avatar_url":"https://avatars.githubusercontent.com/u/12252854?v=3","gravatar_id":"","url":"https://api.github.com/users/yosukeh","html_url":"https://github.com/yosukeh","followers_url":"https://api.github.com/users/yosukeh/followers","following_url":"https://api.github.com/users/yosukeh/following{/other_user}","gists_url":"https://api.github.com/users/yosukeh/gists{/gist_id}","starred_url":"https://api.github.com/users/yosukeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yosukeh/subscriptions","organizations_url":"https://api.github.com/users/yosukeh/orgs","repos_url":"https://api.github.com/users/yosukeh/repos","events_url":"https://api.github.com/users/yosukeh/events{/privacy}","received_events_url":"https://api.github.com/users/yosukeh/received_events","type":"User","site_admin":false},"created_at":"2016-03-02T22:57:51Z","updated_at":"2016-03-02T22:57:51Z","body":"計測用SQL\r\n\r\nSELECT * \r\nFROM symptom_record\r\nLEFT JOIN symptom_log ON symptom_record.id = symptom_log.symptom_record__id\r\nWHERE user_account_id =39\r\nAND  `show` =1\r\nAND (\r\nsymptom_log.isDeleted =0\r\nOR symptom_log.isDeleted IS NULL\r\n)\r\nLIMIT 0 , 3000"}}