Skip to content

fix(perf): query/index/payload hardening on hot read/merge/prune path… - #48

Merged
weepaho3 merged 1 commit into
mainfrom
fix/perf
Jul 8, 2026
Merged

fix(perf): query/index/payload hardening on hot read/merge/prune path…#48
weepaho3 merged 1 commit into
mainfrom
fix/perf

Conversation

@weepaho3

@weepaho3 weepaho3 commented Jul 8, 2026

Copy link
Copy Markdown
Owner

No description provided.

…s (pf-03…15)

- pf-03: add roots (collection, slug) index for the public getPublishedContent
  slug lookup (was falling back to an in-index scan on collection).
- pf-06: drop the unused bv_properties_gin GIN index — no query can use it
  (all predicates are ->> ILIKE), pure write amplification on block_versions;
  also fixed a false 'uses the JSONB GIN index' comment in revalidation.ts.
- pf-07: getPublishedContent gains an optional branchName selector (additive,
  resolves a single published branch); embedded A/B refs no longer serialize
  the control tree twice (control is top-level tree; abTest.variants carries
  only non-control variants). Shape change: read control from the top-level tree.
- pf-04: parallel internal link-path resolution (was sequential per target/variant).
- pf-05: slim COUNT(DISTINCT roots.id) for listRoots total instead of re-running
  the full aggregate + enrichment join twice.
- pf-11: executeRootPruning deletes prunable commits in ONE set-based statement
  (single-statement is required — the commits self-FKs are NO ACTION checked at
  statement end, so chunking would break FK integrity across chunk boundaries).
- pf-12: archiveAssets batches the live-reference liveness check.
- pf-08: executeMerge computes the merge base before the FOR UPDATE locks and
  reuses it only when the locked heads are unchanged (shorter lock hold, same
  merge-base semantics; no TOCTOU — re-reads + recomputes under the lock).
- pf-15: kept .returning() for bulk notification counts (DrizzleInstance is
  driver-agnostic; PGlite exposes no rowCount — documented).
- pf-02/09/10/13/14: doc notes for intentional cost tradeoffs; pf-09 serial
  recursion kept (shared visited cycle-guard). pf-01 already done by react-01.
- examples/*/db/schema.ts regenerated to track the index changes.

Adversarial review caught a real FK bug in the initial pf-11 chunked delete;
fixed to a single statement. Full suite (1053) + tsc + lint + docs build green;
example boots 200 with the new schema.
@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
createcms-docs Ready Ready Preview, Comment Jul 8, 2026 10:53pm

@weepaho3
weepaho3 merged commit a590c75 into main Jul 8, 2026
3 checks passed
@weepaho3
weepaho3 deleted the fix/perf branch July 8, 2026 22:53
@github-actions github-actions Bot mentioned this pull request Jul 8, 2026
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