{"action":"created","issue":{"url":"https://api.github.com/repos/AlchemyCMS/alchemy_cms/issues/911","labels_url":"https://api.github.com/repos/AlchemyCMS/alchemy_cms/issues/911/labels{/name}","comments_url":"https://api.github.com/repos/AlchemyCMS/alchemy_cms/issues/911/comments","events_url":"https://api.github.com/repos/AlchemyCMS/alchemy_cms/issues/911/events","html_url":"https://github.com/AlchemyCMS/alchemy_cms/pull/911","id":125391453,"number":911,"title":"Eliminate an SQL lookup on frontend cached element partials","user":{"login":"mtomov","id":1651750,"avatar_url":"https://avatars.githubusercontent.com/u/1651750?v=3","gravatar_id":"","url":"https://api.github.com/users/mtomov","html_url":"https://github.com/mtomov","followers_url":"https://api.github.com/users/mtomov/followers","following_url":"https://api.github.com/users/mtomov/following{/other_user}","gists_url":"https://api.github.com/users/mtomov/gists{/gist_id}","starred_url":"https://api.github.com/users/mtomov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtomov/subscriptions","organizations_url":"https://api.github.com/users/mtomov/orgs","repos_url":"https://api.github.com/users/mtomov/repos","events_url":"https://api.github.com/users/mtomov/events{/privacy}","received_events_url":"https://api.github.com/users/mtomov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-07T13:10:50Z","updated_at":"2016-01-07T13:10:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/AlchemyCMS/alchemy_cms/pulls/911","html_url":"https://github.com/AlchemyCMS/alchemy_cms/pull/911","diff_url":"https://github.com/AlchemyCMS/alchemy_cms/pull/911.diff","patch_url":"https://github.com/AlchemyCMS/alchemy_cms/pull/911.patch"},"body":"   * when not using page caching\r\n\r\n   When page_cache is not turned off, it is unnecessary to store the\r\n   element within the page it is being rendered using the `store_page`\r\n   method. Thereby, the method call is unnecessary, and avoiding it\r\n   saves an SQL query on every cached element render.\r\n\r\n     Alchemy::Page Exists (2.2ms)  SELECT  DISTINCT 1 AS one FROM `alchemy_pages` INNER JOIN `alchemy_elements_alchemy_pages` ON `alchemy_pages`.`id` = `alchemy_elements_alchemy_pages`.`page_id` WHERE `alchemy_elements_alchemy_pages`.`element_id` = 569 AND `alchemy_pages`.`id` = 2 LIMIT 1\r\n\r\n  So, if a non-cached page with N elements would result in N such queries.\r\n\r\n  This change saves those Exists lookups.\r\n\r\nLet me know if you prefer to place the pull request against 3.2 instead of master. \r\n\r\nThank you!"},"comment":{"url":"https://api.github.com/repos/AlchemyCMS/alchemy_cms/issues/comments/169659636","html_url":"https://github.com/AlchemyCMS/alchemy_cms/pull/911#issuecomment-169659636","issue_url":"https://api.github.com/repos/AlchemyCMS/alchemy_cms/issues/911","id":169659636,"user":{"login":"TeatroIO","id":7524941,"avatar_url":"https://avatars.githubusercontent.com/u/7524941?v=3","gravatar_id":"","url":"https://api.github.com/users/TeatroIO","html_url":"https://github.com/TeatroIO","followers_url":"https://api.github.com/users/TeatroIO/followers","following_url":"https://api.github.com/users/TeatroIO/following{/other_user}","gists_url":"https://api.github.com/users/TeatroIO/gists{/gist_id}","starred_url":"https://api.github.com/users/TeatroIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TeatroIO/subscriptions","organizations_url":"https://api.github.com/users/TeatroIO/orgs","repos_url":"https://api.github.com/users/TeatroIO/repos","events_url":"https://api.github.com/users/TeatroIO/events{/privacy}","received_events_url":"https://api.github.com/users/TeatroIO/received_events","type":"User","site_admin":false},"created_at":"2016-01-07T13:10:50Z","updated_at":"2016-01-07T13:10:50Z","body":"I've prepared a stage to preview changes. <a href='http://mtomov-eliminate-element-db-lookup-query.alchemycms-alchemy-cms-42e8f4fc945384e0f6b5.ttrcloud.com/admin' target='_blank'>Open stage</a> or <a href='http://mtomov-eliminate-element-db-lookup-query.alchemycms-alchemy-cms-42e8f4fc945384e0f6b5.ttrcloud.com/admin/teatro.log' target='_blank'>view logs</a>."}}