Django bulk_update Memory Issue

Recently, I had to write a Django migration to update hundreds of thousands of database objects. Loading the data With some paper-napkin math I calculated that I can fit all the necessary data in memory, making the migration much simpler than it would have been otherwise. First I had to make sure to load only the necessary columns. Django&rsquo;s only queryset method came in very handy:…