{"action":"created","issue":{"url":"https://api.github.com/repos/Icinga/icingaweb2-module-director/issues/1250","repository_url":"https://api.github.com/repos/Icinga/icingaweb2-module-director","labels_url":"https://api.github.com/repos/Icinga/icingaweb2-module-director/issues/1250/labels{/name}","comments_url":"https://api.github.com/repos/Icinga/icingaweb2-module-director/issues/1250/comments","events_url":"https://api.github.com/repos/Icinga/icingaweb2-module-director/issues/1250/events","html_url":"https://github.com/Icinga/icingaweb2-module-director/pull/1250","id":266907540,"number":1250,"title":"GroupMembershipResolver: Prefetch related objects before resolving","user":{"login":"lazyfrosch","id":121874,"avatar_url":"https://avatars2.githubusercontent.com/u/121874?v=4","gravatar_id":"","url":"https://api.github.com/users/lazyfrosch","html_url":"https://github.com/lazyfrosch","followers_url":"https://api.github.com/users/lazyfrosch/followers","following_url":"https://api.github.com/users/lazyfrosch/following{/other_user}","gists_url":"https://api.github.com/users/lazyfrosch/gists{/gist_id}","starred_url":"https://api.github.com/users/lazyfrosch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lazyfrosch/subscriptions","organizations_url":"https://api.github.com/users/lazyfrosch/orgs","repos_url":"https://api.github.com/users/lazyfrosch/repos","events_url":"https://api.github.com/users/lazyfrosch/events{/privacy}","received_events_url":"https://api.github.com/users/lazyfrosch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-10-19T16:31:02Z","updated_at":"2017-10-19T19:07:13Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/Icinga/icingaweb2-module-director/pulls/1250","html_url":"https://github.com/Icinga/icingaweb2-module-director/pull/1250","diff_url":"https://github.com/Icinga/icingaweb2-module-director/pull/1250.diff","patch_url":"https://github.com/Icinga/icingaweb2-module-director/pull/1250.patch"},"body":"Without this resolving can be slowed down by database queries for\r\nrelated objects.\r\n\r\n---\r\n\r\nI found this while syncing about 6700 hosts with about 1800 hostgroups present.\r\n\r\nDirector permanently queried for related objects.\r\n\r\nThe program is still burning on the sync as I post this, so potentially still WIP here. But its a large environment..."},"comment":{"url":"https://api.github.com/repos/Icinga/icingaweb2-module-director/issues/comments/338006881","html_url":"https://github.com/Icinga/icingaweb2-module-director/pull/1250#issuecomment-338006881","issue_url":"https://api.github.com/repos/Icinga/icingaweb2-module-director/issues/1250","id":338006881,"user":{"login":"Thomas-Gelf","id":553008,"avatar_url":"https://avatars2.githubusercontent.com/u/553008?v=4","gravatar_id":"","url":"https://api.github.com/users/Thomas-Gelf","html_url":"https://github.com/Thomas-Gelf","followers_url":"https://api.github.com/users/Thomas-Gelf/followers","following_url":"https://api.github.com/users/Thomas-Gelf/following{/other_user}","gists_url":"https://api.github.com/users/Thomas-Gelf/gists{/gist_id}","starred_url":"https://api.github.com/users/Thomas-Gelf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thomas-Gelf/subscriptions","organizations_url":"https://api.github.com/users/Thomas-Gelf/orgs","repos_url":"https://api.github.com/users/Thomas-Gelf/repos","events_url":"https://api.github.com/users/Thomas-Gelf/events{/privacy}","received_events_url":"https://api.github.com/users/Thomas-Gelf/received_events","type":"User","site_admin":false},"created_at":"2017-10-19T19:07:13Z","updated_at":"2017-10-19T19:07:13Z","author_association":"CONTRIBUTOR","body":"You're right, those queries shouldn't happen at all. The proposed fix might help with your Sync, but slow down other things. This resolver is also eventually being called every time you save a single Host or Group, it would slow down the GUI fully pre-fetching all eventually related objects all the times.\r\n\r\nIn addition to this, Sync would not at all need those Objects, as a simple id/name map would suffice. Need to dig deeper into this, but that will probably not happen before Monday.\r\n\r\nCheers,\r\nThomas\r\n\r\nNB: I probably haven't met those queries on Sync yet, as setting command and timezone properties directly on host objects is not considered a good practice and not even available in the GUI. Still, this is of course perfectly valid."}}
{"actor":{"display_login":"Thomas-Gelf"}}