Opened 10 years ago
Last modified 15 months ago
#24306 new New feature
Support for UNLOGGED tables in PostgreSQL
Description ¶
According to stack overflow, unlogged tables are the way to go for testing speed. See http://stackoverflow.com/questions/9407442/optimise-postgresql-for-fast-testing/9407940#9407940 for example.
As part of another, now rejected ticket, somebody wrote support for unlogged tables:
https://github.com/aptivate/django/commits/ticket_19891 first commit: https://github.com/aptivate/django/commit/657a1fee1ad3899f1254a971f32a6cea7b11c0a3
Support for unlogged tables for testing would be really helpful for having tests run faster.
According to the ticket's flags, the next step(s) to move this issue forward are:
- To provide a patch by sending a pull request. Claim the ticket when you start working so that someone else doesn't duplicate effort. Before sending a pull request, review your work against the patch review checklist. Check the "Has patch" flag on the ticket after sending a pull request and include a link to the pull request in the ticket comment when making that update. The usual format is:
[https://github.com/django/django/pull/#### PR]
.
Change History (6)
comment:1 by , 10 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Version: | 1.7 → master |
comment:2 by , 10 years ago
comment:3 by , 8 years ago
Replying to freyley:
Support for unlogged tables for testing would be really helpful for having tests run faster.
I've tried this a while ago (by hacking Django's internals) and there was not much gain from it.
But I was using most(?) of https://www.postgresql.org/docs/current/static/non-durability.html already.
comment:4 by , 4 years ago
Cc: | added |
---|
comment:5 by , 15 months ago
A different use for UNLOGGED tables could be for the database cache backend: https://martinheinz.dev/blog/105. Would it be an option to allow specifying an --unlogged
parameter for the createcachetable
command to create an UNLOGGED table for the database cache?
comment:6 by , 15 months ago
Some discussion here. Looks like the Postgresql-specific option may be a problem, and the UNLOGGED feature may not give much performance improvement for caches.
According to discussion on django-developers unlogged tables actually decreased performance for Django's own test suite.