Dashboard performance — faster lists and prefix company search
What changed
-
Faster list endpoints —
GET /v3/locations,GET /v3/services,GET /v3/resources, andGET /v3/companiesnow read with a smaller include shape (the list responses no longer eager-loadAddressorCompanyobjects) and count the total with a directCOUNT(*)on the base table when no association filter is applied. The response fields stay the same when you list withoutinclude; fetch a single resource (or passinclude=services,resources/include=locations,resourcesetc.) to hydrate the full object graph. A short per-request Redis cache collapses dashboard refresh bursts into a single database round trip. -
Company search is now a prefix match — The optional
searchquery parameter onGET /v3/companies(used by the dashboard company switcher) now matches company names by prefix, backed by a functional lower-name index. A search foracmematches “Acme Corp” and “ACME Clinic” but no longer matches “Great Acme Holdings.” If you rely on the old substring behavior, switch your client to match by leading characters (for example, type the start of the company name rather than a substring). -
Dashboard navigation — The company switcher debounces typed input a little longer and skips one-character queries (which match almost everything and only add load) before issuing a request. The locations, services, and resources dashboards no longer re-fetch the full company-wide lists on every row click; they prime reference data once per company context and leave warm caches alone.
Integration notes
- Public API callers that pass
include=services,resources(or analogous combinations) continue to receive the same nested payload on the list endpoints. Only the default (no-include) list shape trims the always-on Address/Company objects, which were never documented as part of the list payload. - The prefix search is the only customer-visible behavior change on
GET /v3/companies?search=…. The parameter name, limit, and offset semantics are unchanged. - No migrations are required on the caller side. A Postgres functional index (
company_lower_name_prefix_active_idx) is added by a platform migration for the new prefix search.
