Skip to content

cost(P7): bound admin/backfill whole-table Scans #40

Closed

Description

@jjbaumert

Priority: P7 (cost, low frequency) — Tier 3. Part of the 2026-07-11 DynamoDB query-cost review.

Problem

Whole-table Scans on admin/backfill-only paths: doc_repo.list_all_meta (backfill.rs:243), admin list_users (routes/admin.rs), and the list-all-profiles scan (user_repo.rs:588). Acceptable given low frequency, but unbounded scans are a latent cost/timeout risk as tables grow.

Fix

Ensure all are paginated with sane page caps; keep them off any user-facing path.

CRDT impact: none.

Activity

  1. jjbaumert commented on Jul 14, 2026

    @jjbaumert
    OwnerAuthor

    Already addressed. All three named scan sites are paginated with caps today:

    • doc_repo.list_all_meta — takes limit, resumes from a cursor, loops per-page and returns (Vec, Option<next>).
    • user_repo.list_all (the list-all-profiles scan) — same shape: limit.max(1) cap, cursor seed, per-page last_evaluated_key loop, returns a next-cursor on a full page.
    • admin list_users (routes/admin.rs) — limit = params.limit.unwrap_or(50).min(200) + cursor, delegating to user_repo.list_all.

    All are admin/backfill-only (off user-facing paths). Closing as done; reopen if a specific still-unbounded admin scan remains.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions