Leasing staff "All companies": read by company, not by building

Design for option A of the p11-page-leasing C2 decision. It covers which rows get a company key, who writes it, how old rows get it, and what it saves. It is a design for Gera to decide on, not code.

2026-09-28 · lane REV for driver 1fdb267c · status: proposal, nothing built · measured on stage and prod logs (read-only)

The verdict, in plain English

The staff "All companies" leasing numbers are slow because every piece of data is fetched one building at a time: about 8.5 database calls per building, 598 for one 70-building company.

Fetch each piece once per company instead. Two of the six pieces (prospects and tenants) already carry a company key; units, leases, tours and renewal rows need one, stamped by their existing writers and backfilled once.

Estimated: the 70-building leg drops from ~598 calls to a few dozen, and cold load from ~2.5 s to well under 1 s. This is an estimate, to be measured after a stage backfill.

Ships dark: keys first, backfill (dry-run by default, apply is Gera's call), a parity check, then the reader flips. Nothing a customer sees changes.

PropFlow Docs