Conversation
…sh prune and delivery pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Performance work, behavior-neutral: statements that ran once per row now run once per request, independent reads run together, seven indexes back slow lookups, several admin and host queries read index ranges instead of whole tables, and four spots that blocked the server's event loop (the slur filter, the CSV export guard, certificate fonts, map pin signing) now do a small fraction of the work. Nothing a user sees should change, except that some screens answer faster.
Before you start
Verify
Nothing new to verify: every step below is a regression check of a flow whose queries changed.
Regression
Hosting an event — [Web]
Check-in and messages — [Web] [Mobile]
Team and organizations — [Web] [Mobile] [Admin]
Host portfolio — [Web] [Mobile]
Posts, chat and polls — [Web] [Mobile]
Followers and volunteer hours — [Web] [Mobile]
Exports and reports — [Web] [Mobile]
Admin — [Admin]
Findings addressed
Campaign PR 13 (performance). Each change carries its measurement or its algorithmic argument; none changes a result, an order, an error or a response except the failure-only differences listed under decisions.
Round trips (per-row SQL and sequential awaits)
unnest).Indexes (migrations 0186–0192, none on a hot table)
Query shapes
Event loop (CPU and synchronous I/O)
Decisions for the reviewer
mail_eventsindex (0189): the out-of-band index doc and CLAUDE.md do not list mail tables as hot, so it builds inline; the civfix-migration skill does. The table grows only with outbound mail and the build takes a SHARE lock (inserts wait, reads do not). If staging or production has a largemail_events, build it CONCURRENTLY first; the migration is then a no-op.User-visible copy changes
None.
Tests changed
Verification
pnpm typecheck,pnpm lint,check:sql, prettier clean; api unit suite by path 439 files, 7381 passed, 3 skipped; media-worker unit 300 passed, 2 failed (the known arm64 ffprobe helper issue fixed in Backend test safety net: SQL transcripts, CSRF pairing, authz and characterization tests #92).Staging checks
https://api.civfix.dev/readyzanswers ready after migrations 0186–0192.SELECT pg_size_pretty(pg_total_relation_size('mail_events')); if it is large, buildmail_events_bounced_recipient_idxCONCURRENTLY first.EXPLAIN (ANALYZE, BUFFERS)on a followers page, a jurisdiction directory page and a ticket type delete shows the new indexes.Not covered
🤖 Generated with Claude Code