Skip to content

feat: add pg_textsearch tuning support - #148

Open
tjgreen42 wants to merge 4 commits into
mainfrom
feat/pg-textsearch-tuning
Open

feat: add pg_textsearch tuning support#148
tjgreen42 wants to merge 4 commits into
mainfrom
feat/pg-textsearch-tuning

Conversation

@tjgreen42

@tjgreen42 tjgreen42 commented Apr 21, 2026

Copy link
Copy Markdown

When pg_textsearch appears in shared_preload_libraries, the tuner now recommends a value for pg_textsearch.memory_limit scaled to total system memory (totalMemory/4 for the default profile; totalMemory/8 for promscale, which already reserves half of RAM for shared_buffers). This GUC puts a hard cap on shared memory used by the extension.

Todd J. Green added 4 commits April 20, 2026 19:48
When pg_textsearch is listed in shared_preload_libraries, the tuner now
recommends a value for pg_textsearch.memory_limit based on total system
memory (totalMemory/4 for the default profile, totalMemory/8 for
promscale, which already allocates half of RAM to shared_buffers).
Detection is automatic: if pg_textsearch is absent from the conf file,
no recommendation is emitted.
The PG18 timescale image stores its data under /var/lib/postgresql/18/docker
rather than /var/lib/postgresql/data, so the hardcoded TMPDIR caused the
backup write to fail. Deriving it from the config file's parent directory
keeps the existing behavior for pg10-pg17 while working for pg18.
- parseLineForSharedLibResult now does a comma-token exact match for both
  timescaledb and pg_textsearch, so libraries like my_pg_textsearch or
  timescaledb_toolkit no longer trigger detection.
- Replaced the underscore-based displayLabel heuristic with an optional
  displayLabeler interface implemented by PgTextsearchSettingsGroup.
- Extracted pgTextsearchDetected() helper so the Tuner.Run wiring has
  direct unit-test coverage.
- Integration workflow now uses TMPDIR=/tmp rather than pointing backups
  into the PG data directory.
- Clarified README to state the memory_limit ratios.
@tjgreen42
tjgreen42 marked this pull request as ready for review April 24, 2026 15:50
@tjgreen42
tjgreen42 requested a review from alexeyklyukin April 24, 2026 15:50
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.

1 participant