{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/addons-server/issues/8831","repository_url":"https://api.github.com/repos/mozilla/addons-server","labels_url":"https://api.github.com/repos/mozilla/addons-server/issues/8831/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/addons-server/issues/8831/comments","events_url":"https://api.github.com/repos/mozilla/addons-server/issues/8831/events","html_url":"https://github.com/mozilla/addons-server/issues/8831","id":340247233,"node_id":"MDU6SXNzdWUzNDAyNDcyMzM=","number":8831,"title":"Optimize how we serialize translations in the API","user":{"login":"EnTeQuAk","id":139033,"node_id":"MDQ6VXNlcjEzOTAzMw==","avatar_url":"https://avatars1.githubusercontent.com/u/139033?v=4","gravatar_id":"","url":"https://api.github.com/users/EnTeQuAk","html_url":"https://github.com/EnTeQuAk","followers_url":"https://api.github.com/users/EnTeQuAk/followers","following_url":"https://api.github.com/users/EnTeQuAk/following{/other_user}","gists_url":"https://api.github.com/users/EnTeQuAk/gists{/gist_id}","starred_url":"https://api.github.com/users/EnTeQuAk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EnTeQuAk/subscriptions","organizations_url":"https://api.github.com/users/EnTeQuAk/orgs","repos_url":"https://api.github.com/users/EnTeQuAk/repos","events_url":"https://api.github.com/users/EnTeQuAk/events{/privacy}","received_events_url":"https://api.github.com/users/EnTeQuAk/received_events","type":"User","site_admin":false},"labels":[{"id":297624531,"node_id":"MDU6TGFiZWwyOTc2MjQ1MzE=","url":"https://api.github.com/repos/mozilla/addons-server/labels/component:%20code%20quality","name":"component: code quality","color":"107c05","default":false},{"id":382390917,"node_id":"MDU6TGFiZWwzODIzOTA5MTc=","url":"https://api.github.com/repos/mozilla/addons-server/labels/component:%20performance","name":"component: performance","color":"107c05","default":false},{"id":821171071,"node_id":"MDU6TGFiZWw4MjExNzEwNzE=","url":"https://api.github.com/repos/mozilla/addons-server/labels/priority:%20p3","name":"priority: p3","color":"a4000f","default":false},{"id":540035677,"node_id":"MDU6TGFiZWw1NDAwMzU2Nzc=","url":"https://api.github.com/repos/mozilla/addons-server/labels/triaged","name":"triaged","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-11T13:41:03Z","updated_at":"2018-07-30T10:54:38Z","closed_at":null,"author_association":"MEMBER","body":"While looking at one of our views with the highest db-query count I noticed that our `TranslationSerializerField` implementation doesn't make use of our translations helpers, e.g `attach_translations` etc. That makes it's implementation much simpler but is a pain for everything using translations in the API. So, whenever one or many add-ons are requested we have as many queries to the translations table as we have add-ons. Additional to that, some other fields that may have translations etc.\r\n\r\nThis is particularly bad in `/api/v4/accounts/account/mozilla/collections/change-up-your-tabs/addons/` which goes through all sorts of serializers and ends up querying translations for every add-on separately.\r\n\r\nOptimizing translation-querying alone will bring down our query counts massively and speed up our API as well as bring down our database load."},"comment":{"url":"https://api.github.com/repos/mozilla/addons-server/issues/comments/408824914","html_url":"https://github.com/mozilla/addons-server/issues/8831#issuecomment-408824914","issue_url":"https://api.github.com/repos/mozilla/addons-server/issues/8831","id":408824914,"node_id":"MDEyOklzc3VlQ29tbWVudDQwODgyNDkxNA==","user":{"login":"diox","id":187006,"node_id":"MDQ6VXNlcjE4NzAwNg==","avatar_url":"https://avatars0.githubusercontent.com/u/187006?v=4","gravatar_id":"","url":"https://api.github.com/users/diox","html_url":"https://github.com/diox","followers_url":"https://api.github.com/users/diox/followers","following_url":"https://api.github.com/users/diox/following{/other_user}","gists_url":"https://api.github.com/users/diox/gists{/gist_id}","starred_url":"https://api.github.com/users/diox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diox/subscriptions","organizations_url":"https://api.github.com/users/diox/orgs","repos_url":"https://api.github.com/users/diox/repos","events_url":"https://api.github.com/users/diox/events{/privacy}","received_events_url":"https://api.github.com/users/diox/received_events","type":"User","site_admin":false},"created_at":"2018-07-30T10:54:38Z","updated_at":"2018-07-30T10:54:38Z","author_association":"MEMBER","body":"Note that this is only a problem with a client requests all translations - i.e. when they are not passing the `lang` parameter, which should not happen that often - basically only when they need to edit something. This is why I didn't care about optimizing this when I first wrote it."}}
{"actor":{"display_login":"diox"}}