Skip to content

Reduce database-bound hi completion latency #998

Closed

Description

@gouhongshen

Problem

A Server instance connected directly to the remote MatrixOne test account completes a simple hi stream well above the target P90 7s. Profiling the same SHA and model showed hundreds of request-scoped SQL statements, many of which came from repeatedly committing small live-event batches and separately releasing the canonical writer after committing the canonical turn.

Evidence

  • Baseline SHA 07813786f, 12 isolated hi trials: terminal P50 8.80s, P90 10.20s.
  • A representative request executed roughly 430–467 request-scoped SQL statements.
  • Live fanout had a 25ms coalescing window, so a simple request repeatedly committed tiny event batches.
  • Canonical turn commit and writer release were two transactions. The latter duplicated lifecycle-fence admission, state lock, state update, and authority audit.
  • Run creation already commits run, slot, initial events, and display projection atomically, but the caller still performed a post-commit full projection rebuild.

Desired behavior

Reduce request SQL and transaction count without weakening ownership fencing, durable ordering, replay, audit, or billing.

Activity

  1. changed the title [-]Reduce database-bound completion latency[/-] [+]Reduce database-bound `hi` completion latency[/+] on Oct 13, 2026
  2. XuPeng-SH commented on Oct 20, 2026

    @XuPeng-SH
    Collaborator

    Cleanup: merged PR #999 explicitly closes this issue and implements the database-bound latency and duplicate-work reductions described here. Closing now.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions