Skip to content

perf(web): bound search result text at the database #33

Description

@davidvornholt

Search caps the browser response at 50 days, but the database query still transfers the complete journal_search_text, scripture_search_text, and scripture_reference_search_text values for every matching row before the application cuts a 240-character excerpt. Large pasted entries can therefore turn a small result page into tens of megabytes of database transfer and process allocation.

Move excerpt generation close enough to PostgreSQL that the query returns bounded result text. Seed 50 matching rows whose three projection columns grow from small entries to multi-megabyte entries. Record returned query bytes, p95 latency over 100 warm runs, and peak process-heap delta before and after the change. The acceptance bound is at most 64 KiB of returned projection or excerpt text for 50 hits, independent of the stored entry size; latency and heap must no longer grow with the complete projection values.

Deferred from PR #23 because the row count is capped and the blocking privacy, error-boundary, tokenizer, normalization, and result-attribution defects take precedence.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    deferred-findingDeferred review finding filed by a review-fix cycle

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions