← Back to Pull requests

pgdb: drop the fts_data GIN index for messages with no full-text field #151

Closed
tthayer closed this pull request without merging on Jul 15, 2026 19:31 UTC
View on GitHub
tthayer tthayer commented on Jul 14, 2026 16:33 UTC
Author

Stacked on #149.

Summary

Follow-up to the stop-creating change: for messages with no direct full-text field, emit the fts_data BTREE_GIN index as IsDropped: true instead of omitting it. The schema migration path then issues DROP INDEX IF EXISTS … CONCURRENTLY to remove the existing (always-NULL, never-matching) index on already-provisioned tables — and still never creates it for new tables.

This is the deliberate "purge existing" step: the earlier change stops creating the dead index (no impact on existing tables); this one drops the ones already there.

Change

  • internal/pgdb/pgdb_index.go: always emit the fts_data index; set IsDropped: true when the message has no full-text field.

  • Regenerated example: Newspaper and the city.* messages now emit the index as dropped; Pet / ScalarValue / Book keep it.

  • Test asserts the index is present-and-dropped for Newspaper, present-and-not-dropped for Pet.
  • Rollout note

    A consumer regenerating against this emits DROP INDEX … CONCURRENTLY for every affected model on the next schema apply — sequence mindful of write load on large tables.

    Verification

  • go build ./... passes; make example regenerates cleanly.

  • Pre-existing fts_test.go failures in a bare checkout are unrelated (require a local PostgreSQL binary).
  • Diff: 339 lines (+315 / -24) across 4 files Reviewer: None requested Review duration: 1618m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.54) × (1 − Review Confidence (0.58)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.54 · 339 lines diff across 4 files
    0.54
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 10%
    57%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.349
    Shallow Review Depth shallow_review_depth
    0.289
    No Reviewer Assigned no_reviewer_assigned
    0.120
    Real PR Conversation Timeline
    1 comments
    "Review active on #151"
    general weight: 0.35
    Reviewers
    None requested
    Assignees
    tthayer tthayer
    Labels
    risk: low confidence: 58.0% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 54.3% (MEDIUM) · Higher = larger blast radius
    54.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 58.0% · Lower = rushed or shallow review
    58.0%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.8% · Safe to merge
    22.8%