Commit c0a195c
committed
Add UNLOGGED tables rake task for optional test performance
Adds db:test:unlogged task that converts all PostgreSQL tables to
UNLOGGED mode. UNLOGGED tables skip WAL logging, which can make
writes faster during test setup.
Benchmarks on this codebase showed minimal impact (~1%):
- Model specs: 13.7s (LOGGED) vs 13.8s (UNLOGGED)
- Full suite: 87s (LOGGED) vs 86s (UNLOGGED)
The benefit depends on your test suite characteristics:
- More useful if you have many feature specs with heavy database writes
- Less useful if most tests use transactional fixtures
Auto-runs after db:test:prepare when in test environment.
Can be removed if it causes issues or doesn't help your workload.1 parent 7640305 commit c0a195c
1 file changed
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
0 commit comments