KamoCRM

Answer a status write before its follow-ups, and read lead rows by their own key

Performancekamo-shared-library
Shipped
November 6, 2026 at 6:31 PM UTC
Author
Kamo
Commit
5b273d8

Call Floor outcome press, profiled with JFR on a SecurityService pod (lab org, 40 presses): the /stage write took 160-360 ms, median ~220 ms. About 90 ms of it was the after-commit follow-ups nobody waits for: the contact tracker (status label read + 2-3 upserts, each its own YugabyteDB commit) and the pipeline follower (a second full Lead load). A service that declares the new LeadStatusFollowUps executor now answers once the status has committed and runs those two on it; without one they run inline as before. Stop All Outreach and the due-callback close stay synchronous. YugabyteDB's planner is heuristic: "org_id = ? AND <key>" walks the org's index. Measured on the largest org (EXPLAIN ANALYZE, read-only): - lead history by lead: 17.9 s -> 35 ms. The per-lead reads go by lead_uid, org checked by key. - DialLedger first-text lead read: 7.15 s -> ~1.5 ms (uid only, org checked in Java). - **************** by uid only, org checked in Java (recording access, labels). - /leads grid with named leads (Selected tab, stream leads): org check written org_id + 0 = ?, 7.06 s -> 4.6 ms; same filter, no index can serve it, so the pk is used.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing