#31276: Add 'flush' option to only clear non-empty tables -------------------------------------+------------------------------------- Reporter: Adam (Chainz) | Owner: nobody Johnson | Type: | Status: new Cleanup/optimization | Component: Database layer | Version: master (models, ORM) | Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+-------------------------------------
Comment (by felixxm): I'm not sure, TBH. Checking no. of rows for each table will have a performance impact, and creating a huge union for all tables (as proposed) may not be better: {{{ (select 't' as has_rows from t limit 1) union (select 't2' as has_rows from t2 limit 1); }}} We need to take into account a few restrictions e.g. the database's limit on the number of query parameters and 3rd-party database backends may not support `UNION`. -- Ticket URL: <https://code.djangoproject.com/ticket/31276#comment:3> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.c1865747e8cb55bee48d857ebf4973c7%40djangoproject.com.