{"action":"created","issue":{"url":"https://api.github.com/repos/doctrine/doctrine2/issues/7418","repository_url":"https://api.github.com/repos/doctrine/doctrine2","labels_url":"https://api.github.com/repos/doctrine/doctrine2/issues/7418/labels{/name}","comments_url":"https://api.github.com/repos/doctrine/doctrine2/issues/7418/comments","events_url":"https://api.github.com/repos/doctrine/doctrine2/issues/7418/events","html_url":"https://github.com/doctrine/doctrine2/issues/7418","id":365939203,"node_id":"MDU6SXNzdWUzNjU5MzkyMDM=","number":7418,"title":"Cascade remove to generate bulk delete SQL","user":{"login":"umpirsky","id":208957,"node_id":"MDQ6VXNlcjIwODk1Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/208957?v=4","gravatar_id":"","url":"https://api.github.com/users/umpirsky","html_url":"https://github.com/umpirsky","followers_url":"https://api.github.com/users/umpirsky/followers","following_url":"https://api.github.com/users/umpirsky/following{/other_user}","gists_url":"https://api.github.com/users/umpirsky/gists{/gist_id}","starred_url":"https://api.github.com/users/umpirsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/umpirsky/subscriptions","organizations_url":"https://api.github.com/users/umpirsky/orgs","repos_url":"https://api.github.com/users/umpirsky/repos","events_url":"https://api.github.com/users/umpirsky/events{/privacy}","received_events_url":"https://api.github.com/users/umpirsky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-02T14:57:33Z","updated_at":"2018-10-02T15:01:33Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"In current implementation `cascade={\"remove\"}` produces `DELETE` query for each record on the \"Many\" side. That can be many `DELETE` queries if there are many related records. :) \r\n\r\nIs it possible to implement (or override outside of Doctrine itself) bulk deletion with single `DELETE FROM table WHERE id IN (...)` query?\r\n\r\n|    Q        |   A\r\n|------------ | ------\r\n| New Feature | yes\r\n| RFC         | no\r\n| BC Break    | no"},"comment":{"url":"https://api.github.com/repos/doctrine/doctrine2/issues/comments/426307781","html_url":"https://github.com/doctrine/doctrine2/issues/7418#issuecomment-426307781","issue_url":"https://api.github.com/repos/doctrine/doctrine2/issues/7418","id":426307781,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNjMwNzc4MQ==","user":{"login":"Ocramius","id":154256,"node_id":"MDQ6VXNlcjE1NDI1Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/154256?v=4","gravatar_id":"","url":"https://api.github.com/users/Ocramius","html_url":"https://github.com/Ocramius","followers_url":"https://api.github.com/users/Ocramius/followers","following_url":"https://api.github.com/users/Ocramius/following{/other_user}","gists_url":"https://api.github.com/users/Ocramius/gists{/gist_id}","starred_url":"https://api.github.com/users/Ocramius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ocramius/subscriptions","organizations_url":"https://api.github.com/users/Ocramius/orgs","repos_url":"https://api.github.com/users/Ocramius/repos","events_url":"https://api.github.com/users/Ocramius/events{/privacy}","received_events_url":"https://api.github.com/users/Ocramius/received_events","type":"User","site_admin":false},"created_at":"2018-10-02T15:01:33Z","updated_at":"2018-10-02T15:01:33Z","author_association":"MEMBER","body":"@umpirsky this is because the removal is scheduled in the `UnitOfWork`, not in the dedicated persister. Optimising that for a batch of entities of the same type (and therefore any deletion at all) should be feasible, check https://github.com/doctrine/doctrine2/blob/b40c2c6b7893c929f754150d480c20f9b22e0afe/lib/Doctrine/ORM/UnitOfWork.php#L1028-L1033"}}
{"actor":{"display_login":"Ocramius"}}