#31276: Add 'flush' option to only clear non-empty tables
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: jonatron
Johnson |
Type: | Status: assigned
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 jonatron):
I've been benchmarking with 1000 tables and 5 tests. You'll notice sqlite
has a problem with too many tables. Also the query for sqlite needs to be:
{{{select * from ( SELECT '{}' AS has_rows FROM {} LIMIT 1 )}}}
instead of
{{{( SELECT '{}' AS has_rows FROM {} LIMIT 1 )}}}
postgres
current behaviour
Ran 5 tests in 1.538s
Ran 5 tests in 1.545s
Ran 5 tests in 1.573s
with patch
Ran 5 tests in 0.807s
Ran 5 tests in 0.880s
Ran 5 tests in 0.812s
mysql
current behaviour
Ran 5 tests in 17.101s
Ran 5 tests in 15.396s
Ran 5 tests in 15.487s
with patch
Ran 5 tests in 3.891s
Ran 5 tests in 3.545s
Ran 5 tests in 3.522s
sqlite - 400 tables
current behaviour
Ran 5 tests in 2.006s
Ran 5 tests in 2.039s
Ran 5 tests in 2.055s
with patch
Ran 5 tests in 0.106s
Ran 5 tests in 0.104s
Ran 5 tests in 0.107s
sqlite - 1000 tables
django.db.utils.OperationalError: too many terms in compound SELECT
--
Ticket URL: <https://code.djangoproject.com/ticket/31276#comment:5>
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.08c951873e8adf9745a1043a084224ac%40djangoproject.com.