-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add command to delete persons with no distinct id's #25657
Conversation
Iterating over them does seem super slow, you can toss raw SQL into Django like so:
You could still have a dry run that just does I tried a "dry run" and got 717680 for that one team so it seems correct? A test never hurts, though. The only catch is bulk deleting like this won't run Django signals, I'm not sure if we have any signals hooked up to Person? edit: I checked and don't see any outside of tests. |
@bretthoerner I went for iterating to avoid taking a lock on the persons table, but if you reckon that's not a concern I'll go for this |
The select ran fast enough for me, and this seems like something we'll run very rarely. 🤷♂️ |
Sounds good, will go with that so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
No description provided.