SQL BenchMEASURED, NOT GUESSED

    ↑↓ to select, Enter to open, Esc to close

    WAL (journal_mode=WAL) is ~1.26× slower than DELETE (default)

    WAL is usually described as faster, but on this machine it was 26% slower. We did not isolate the cause, and this site does not publish guesses — measure it on your own storage.

    Result

    RunWAL (journal_mode=WAL)DELETE (default)Ratio
    Run 114.25311.0631.29×
    Run 213.68312.9421.06×
    Run 313.80010.9401.26×

    Spread over 3 runs: WAL (journal_mode=WAL) CV 1.8% / DELETE (default) CV 8.3% / Ratio CV 8.2%

    WAL (journal_mode=WAL): 14.25msDELETE (default): 11.06msRun1WAL (journal_mode=WAL): 13.68msDELETE (default): 12.94msRun2WAL (journal_mode=WAL): 13.80msDELETE (default): 10.94msRun3

    The statement

    PRAGMA journal_mode=WAL;  -- same 400-row INSERT
    PRAGMA journal_mode=DELETE;  -- same 400-row INSERT

    Conditions

    400 rows inserted into an 8,000-row table; `synchronous=NORMAL`, Windows 11 on NTFS.

    Where this number does not apply

    It can invert with a different filesystem, SSD or `synchronous` setting; on Linux ext4 the common report is the opposite. Do not generalise this number.

    Reproduce

    cd bench && python sqbench.py --samples 9 --out ../data/run.json