#23830: Make expired session clearing on database backend scale better
-------------------------------------+-------------------------------------
     Reporter:  adamchainz           |                    Owner:
         Type:                       |  adamchainz
  Cleanup/optimization               |                   Status:  assigned
    Component:  contrib.sessions     |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
    Has patch:  1                    |  Unreviewed
  Needs tests:  0                    |      Needs documentation:  0
Easy pickings:  1                    |  Patch needs improvement:  0
                                     |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by timgraham):

 I don't think the manual chunking solution proposed on the PR is
 acceptable. That makes the code quite scary.

 Also, when I tested `clearsessions`, I do get a single query:
 {{{
 DELETE FROM "django_session" WHERE "django_session"."expire_date" < %s' -
 PARAMS = (u'2014-11-20 16:13:19.188990',); args=(u'2014-11-20
 16:13:19.188990',
 }}}
 I wonder if you have a FK to `Session` or signal handler that's preventing
 fast-path deletion; see the
 
[https://docs.djangoproject.com/en/dev/ref/models/querysets/#django.db.models.query.QuerySet.delete
 QuerySet.delete()] docs.

--
Ticket URL: <https://code.djangoproject.com/ticket/23830#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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.4ed73b759aa4609293dca4d3eb908e47%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to