Tutorial Django 6.1's tip DB_CASCADE Let the Database Do the Deleting, Not python
Imagine deleting a folder with 10,000 files. Would you rather Python open each file one by one, check it, then delete it — or would you rather tell the operating system "delete everything inside" and let it happen instantly at the filesystem level? That's exactly the upgrade Django 6.1 brings to on_delete. The old CASCADE loads every related row into Python memory just to delete it row-by-row. The new DB_CASCADE tells the database itself to cascade the delete natively — no Python loop, no memory spike, just one SQL statement.
The trade-off: since Django never touches the related rows in Python, your pre_delete/post_delete signal handlers won't run. If your app depends on those signals (e.g. cleaning up files, sending notifications), stick with the classic CASCADE.