Skip to content

pg tuning: SSD planner-cost defaults in docker-compose#200

Merged
NewGraphEnvironment merged 6 commits intomainfrom
199-pg-tuning-ssd-planner-cost-defaults
May 5, 2026
Merged

pg tuning: SSD planner-cost defaults in docker-compose#200
NewGraphEnvironment merged 6 commits intomainfrom
199-pg-tuning-ssd-planner-cost-defaults

Conversation

@NewGraphEnvironment
Copy link
Copy Markdown
Owner

Summary

  • Add random_page_cost=1.1, effective_io_concurrency=200, temp_buffers=64MB to the local Docker fwapg db.command block. Default PostgreSQL values (4.0 / 1 / 8MB) are calibrated for spinning rust and bias the planner away from index scans on segment-keyed lookups.
  • Document the three settings in docker/tuning.md with per-setting rationale, plus an "SSD assumption" note flagging that the M1/cypher docker-compose override file (in rtj) needs the same flags — compose replaces the override command: list, not appends.

Test plan

  • Restart local Docker DB; SHOW random_page_cost; SHOW effective_io_concurrency; SHOW temp_buffers; returns 1.1 / 200 / 64MB.
  • Post-merge, owner reruns one of link's provincial-style runs from M4. Compare median per-WSG wall in data-raw/logs/<TS>_per_wsg_times.csv against the 2026-05-04 baseline (data-raw/logs/provincial_default_extrabreaks/<TS>_per_wsg_times.csv). Acceptance: ≥ 10 % median per-WSG wall reduction at unchanged segment count.
  • Companion rtj change for the M1/cypher override file lands separately so the 32 GB hosts pick up the same flags.

Closes #199

#158 (frs_order_child) closed by PR #193 + follow-ups #195/#196.
#177 (frs_habitat_overlay format) closed by PR #176. Top-level planning
files were leftover from the older workflow — moved into archive
subdirectories with outcome READMEs per planning convention.
Adds random_page_cost=1.1, effective_io_concurrency=200, and
temp_buffers=64MB so postgres stops planning for spinning rust on
the local Docker fwapg instance. All NewGraph hosts run on SSD.

With random_page_cost=4 (the default) the planner systematically
biases away from index scans for segment-keyed lookups in link's
pipeline; 1.1 lets bitmap-index scans win on the hot path.

Verified live: SHOW returns 1.1 / 200 / 64MB after restart.

Relates to #199
Adds three rows to the Settings rationale table for the new
random_page_cost / effective_io_concurrency / temp_buffers values,
plus an SSD assumption section explaining why the PostgreSQL defaults
are wrong for any modern host.

Calls out that the M1/cypher docker-compose override file (tracked
separately in rtj) needs the same flags. Compose merges override
command lists by replacing the base, not appending, so the override
hosts otherwise stay on PostgreSQL defaults.

Relates to #199
@NewGraphEnvironment NewGraphEnvironment merged commit 47e244d into main May 5, 2026
1 check passed
@NewGraphEnvironment NewGraphEnvironment deleted the 199-pg-tuning-ssd-planner-cost-defaults branch May 5, 2026 03:28
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.

pg tuning: SSD planner-cost defaults in docker-compose.yml

1 participant