Changes between Version 2 and Version 3 of Ticket #36526
- Timestamp:
- Jul 27, 2025, 4:25:49 AM (6 weeks ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #36526 – Description
v2 v3 19 19 [https://github.com/anze3db/django-bulk-update-memory A GitHub repository that reproduces the problem with memray results.] 20 20 21 As we can see from the [https://github.com/user-attachments/assets/dd0bdcac-682f-4e79-aa25-aa5a4a2e6b9d memray flamegraph] the majority of the memory in my example (2.1GB) is used to prepare the when statement for all the batches before executing them. If we change this to generate the when statement only for the current batch the memory consumption is going to be greatly reduced. I'd be happy to contribute this patch unless there are concerns on adding more compute between update queries and making the transaction slonger. Let me know :)21 As we can see from the [https://github.com/user-attachments/assets/dd0bdcac-682f-4e79-aa25-aa5a4a2e6b9d memray flamegraph] the majority of the memory in my example (2.1GB) is used to prepare the when statement for all the batches before executing them. If we change this to generate the when statement only for the current batch the memory consumption is going to be greatly reduced. I'd be happy to contribute this patch unless there are concerns on adding more compute between update queries and making the transaction longer. Let me know :) 22 22 23 23 This might be related to https://code.djangoproject.com/ticket/31202, but I decided to open a new issue because I wouldn't mind waiting longer for bulk_update to complete, but the SIGTERM surprised me.