#24018: Support journal_mode=WAL for sqlite
-------------------------------------+-------------------------------------
               Reporter:  funkybob   |          Owner:  nobody
                   Type:  New        |         Status:  new
  feature                            |        Version:  master
              Component:  Database   |       Keywords:
  layer (models, ORM)                |      Has patch:  0
               Severity:  Normal     |    Needs tests:  0
           Triage Stage:             |  Easy pickings:  0
  Unreviewed                         |
    Needs documentation:  0          |
Patch needs improvement:  0          |
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 SQLite, as of 3.7, supports a WAL journal mode
 [https://www.sqlite.org/wal.html]

 It's been my experience that enabling this can dramatically improve
 performance, especially under heavy writes.  I've seen some write-heavy
 operations go from a couple of minutes to a few seconds.

 It can be enabled by executing the command:

     PRAGMA journal_mode=wal;

 which will return 'wal' on success.

 If it fails to apply for any reason, it will return the mode it is in -
 'delete' or 'memory'.

 I propose to add JOURNAL_MODE as an option to the sqlite backend.

 however, some quick tinkering shows that the sqlite backend doesn't ever
 explicitly create the DB, so it's not immediately apparent how to detect
 if/when this command should be issued.

 I am still investigating.

--
Ticket URL: <https://code.djangoproject.com/ticket/24018>
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.7bb7b244796f78ce34ff5dbc7e3c49bb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to