Skip to content

perf: Set tables UNLOGGED before converter COPY in direct-PG mode#31

Merged
jakebromberg merged 1 commit intomainfrom
perf/unlogged-direct-pg
Mar 10, 2026
Merged

perf: Set tables UNLOGGED before converter COPY in direct-PG mode#31
jakebromberg merged 1 commit intomainfrom
perf/unlogged-direct-pg

Conversation

@jakebromberg
Copy link
Member

Summary

  • Move set_tables_unlogged into _run_xml_pipeline before the converter call so COPY targets UNLOGGED tables
  • Remove redundant set_tables_unlogged from _run_database_build_post_import
  • Add unit test verifying call ordering (set_tables_unlogged before convert_and_filter)

Closes #30. See also WXYC/discogs-xml-converter#18 (batch size increase).

Test plan

  • ruff format --check . && ruff check . passes
  • pytest tests/unit/ -v -- 318 passed

The UNLOGGED optimization was only applied in _run_database_build_post_import, which runs after the converter has already finished writing millions of rows via COPY to LOGGED tables. Move set_tables_unlogged into _run_xml_pipeline before the converter call so the heaviest I/O phase (bulk COPY from the Rust converter) benefits from skipping WAL writes.
@jakebromberg jakebromberg merged commit 2c07433 into main Mar 10, 2026
3 checks passed
@jakebromberg jakebromberg deleted the perf/unlogged-direct-pg branch March 10, 2026 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: Set tables UNLOGGED before converter COPY in direct-PG mode

1 participant