{"action":"created","issue":{"url":"https://api.github.com/repos/aimeos/aimeos-laravel/issues/224","repository_url":"https://api.github.com/repos/aimeos/aimeos-laravel","labels_url":"https://api.github.com/repos/aimeos/aimeos-laravel/issues/224/labels{/name}","comments_url":"https://api.github.com/repos/aimeos/aimeos-laravel/issues/224/comments","events_url":"https://api.github.com/repos/aimeos/aimeos-laravel/issues/224/events","html_url":"https://github.com/aimeos/aimeos-laravel/issues/224","id":322538921,"number":224,"title":"Repeated/Redundant Queries","user":{"login":"zbmowrey","id":14931610,"avatar_url":"https://avatars3.githubusercontent.com/u/14931610?v=4","gravatar_id":"","url":"https://api.github.com/users/zbmowrey","html_url":"https://github.com/zbmowrey","followers_url":"https://api.github.com/users/zbmowrey/followers","following_url":"https://api.github.com/users/zbmowrey/following{/other_user}","gists_url":"https://api.github.com/users/zbmowrey/gists{/gist_id}","starred_url":"https://api.github.com/users/zbmowrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zbmowrey/subscriptions","organizations_url":"https://api.github.com/users/zbmowrey/orgs","repos_url":"https://api.github.com/users/zbmowrey/repos","events_url":"https://api.github.com/users/zbmowrey/events{/privacy}","received_events_url":"https://api.github.com/users/zbmowrey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-12T20:01:40Z","updated_at":"2018-05-30T07:17:26Z","closed_at":null,"author_association":"NONE","body":"Zend ZRay is showing a bunch of repeated, identical queries. Haven't added any products or really done anything with the system aside from install the demo data to browse. \r\n\r\n**Environment:** \r\nAimeos ~2018.04 (latest from composer)\r\nLaravel 5.6.21 \r\nPHP 7.2.2-3+ubuntu16.04.1+deb.sury.org+1...\r\nDemo data populated per the how-to for install \r\n\r\n**Description**\r\npage: /admin/default/jqadm/search/product?lang=en\r\n\r\n**This query occurs identically 16 times:**\r\n`\r\n SELECT mlocsi.\"id\" AS \"locale.site.id\", mlocsi.\"code\" AS \"locale.site.code\", mlocsi.\"label\" AS \"locale.site.label\", mlocsi.\"config\" AS \"locale.site.config\", mlocsi.\"status\" AS \"locale.site.status\", mlocsi.\"editor\" AS \"locale.site.editor\", mlocsi.\"mtime\" AS \"locale.site.mtime\", mlocsi.\"ctime\" AS \"locale.site.ctime\" FROM \"mshop_locale_site\" AS mlocsi WHERE mlocsi.\"level\" = 0 AND ( mlocsi.\"code\" = 'default' ) GROUP BY mlocsi.\"id\", mlocsi.\"code\", mlocsi.\"label\", mlocsi.\"config\", mlocsi.\"status\", mlocsi.\"editor\", mlocsi.\"mtime\", mlocsi.\"ctime\" ORDER BY mlocsi.\"id\" ASC LIMIT 100 OFFSET 0 \r\n`\r\n\r\n**As does this one, 17 times:**\r\n`\r\n SELECT lvu.\"id\" AS \"customer.id\", lvu.\"siteid\" AS \"customer.siteid\", lvu.\"label\" AS \"customer.label\", lvu.\"name\" AS \"customer.code\", lvu.\"company\" AS \"customer.company\", lvu.\"vatid\" AS \"customer.vatid\", lvu.\"salutation\" AS \"customer.salutation\", lvu.\"title\" AS \"customer.title\", lvu.\"firstname\" AS \"customer.firstname\", lvu.\"lastname\" AS \"customer.lastname\", lvu.\"address1\" AS \"customer.address1\", lvu.\"address2\" AS \"customer.address2\", lvu.\"address3\" AS \"customer.address3\", lvu.\"postal\" AS \"customer.postal\", lvu.\"city\" AS \"customer.city\", lvu.\"state\" AS \"customer.state\", lvu.\"countryid\" AS \"customer.countryid\", lvu.\"langid\" AS \"customer.languageid\", lvu.\"telephone\" AS \"customer.telephone\",lvu.\"telefax\" AS \"customer.telefax\", lvu.\"email\" AS \"customer.email\", lvu.\"website\" AS \"customer.website\", lvu.\"longitude\" AS \"customer.longitude\", lvu.\"latitude\" AS \"customer.latitude\", lvu.\"birthday\" AS \"customer.birthday\", lvu.\"status\" AS \"customer.status\", lvu.\"vdate\" AS \"customer.dateverified\", lvu.\"password\" AS \"customer.password\", lvu.\"created_at\" AS \"customer.ctime\", lvu.\"updated_at\" AS \"customer.mtime\", lvu.\"editor\" AS \"customer.editor\" FROM \"users\" AS lvu WHERE ( ( lvu.\"id\" = 3 AND 1 = 1 ) ) GROUP BY lvu.\"id\", lvu.\"siteid\", lvu.\"label\", lvu.\"name\", lvu.\"company\", lvu.\"vatid\", lvu.\"salutation\", lvu.\"title\", lvu.\"firstname\", lvu.\"lastname\", lvu.\"address1\", lvu.\"address2\", lvu.\"address3\", lvu.\"postal\", lvu.\"city\", lvu.\"state\", lvu.\"countryid\", lvu.\"langid\", lvu.\"telephone\", lvu.\"telefax\", lvu.\"email\", lvu.\"website\", lvu.\"longitude\", lvu.\"latitude\", lvu.\"birthday\", lvu.\"status\", lvu.\"vdate\", lvu.\"password\", lvu.\"created_at\", lvu.\"updated_at\", lvu.\"editor\" LIMIT 100 OFFSET 0 \r\n`\r\n\r\n**and this one, 16 times:**\r\n`\r\n SELECT mlocla.\"id\" AS \"locale.language.id\", mlocla.\"label\" AS \"locale.language.label\", mlocla.\"siteid\" AS \"locale.language.siteid\", mlocla.\"status\" AS \"locale.language.status\", mlocla.\"mtime\" AS \"locale.language.mtime\", mlocla.\"editor\" AS \"locale.language.editor\", mlocla.\"ctime\" AS \"locale.language.ctime\" FROM \"mshop_locale_language\" AS mlocla WHERE mlocla.\"status\" = 1 GROUP BY mlocla.\"id\", mlocla.\"label\", mlocla.\"siteid\", mlocla.\"status\", mlocla.\"mtime\", mlocla.\"editor\", mlocla.\"ctime\" ORDER BY mlocla.\"id\" ASC LIMIT 100 OFFSET 0 \r\n`\r\n\r\nI'm sure there's a valid reason for pulling the data (eager loading, etc), but a single page load on the products page with the default set of demo products is running 124 queries. Just got me curious as to the economy of this approach. \r\n\r\nI've attached the full ZRay export for convenience. \r\n\r\n[Aimeos-ZRay.txt](https://github.com/aimeos/aimeos-laravel/files/1997896/Aimeos-ZRay.txt)\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/aimeos/aimeos-laravel/issues/comments/393055761","html_url":"https://github.com/aimeos/aimeos-laravel/issues/224#issuecomment-393055761","issue_url":"https://api.github.com/repos/aimeos/aimeos-laravel/issues/224","id":393055761,"user":{"login":"aimeos","id":8647429,"avatar_url":"https://avatars1.githubusercontent.com/u/8647429?v=4","gravatar_id":"","url":"https://api.github.com/users/aimeos","html_url":"https://github.com/aimeos","followers_url":"https://api.github.com/users/aimeos/followers","following_url":"https://api.github.com/users/aimeos/following{/other_user}","gists_url":"https://api.github.com/users/aimeos/gists{/gist_id}","starred_url":"https://api.github.com/users/aimeos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aimeos/subscriptions","organizations_url":"https://api.github.com/users/aimeos/orgs","repos_url":"https://api.github.com/users/aimeos/repos","events_url":"https://api.github.com/users/aimeos/events{/privacy}","received_events_url":"https://api.github.com/users/aimeos/received_events","type":"User","site_admin":false},"created_at":"2018-05-30T07:17:26Z","updated_at":"2018-05-30T07:17:26Z","author_association":"OWNER","body":"We solved this by caching the result as @zbmowrey suggested. Blink does the same but involves an additional dependency"}}
{"actor":{"display_login":"aimeos"}}