KamoCRM

Pin the heads' names query onto users_pkey — /*+ IndexScan(u users_pkey) */ first in the statement, as loadMembers and the org chart's people query; without it the legacy planner seq-scans all of users per head row (KamoCollab CP02 final fix)

FixSecurityService
Shipped
October 5, 2026 at 10:27 PM UTC
Author
Kamo
Commit
f018816

Production EXPLAIN (sp00verify, read-only): the unhinted literal plan was a nested loop over Seq Scan on users (106 rows) for 1 and 2 ids; with the hint every plan, literal and generic prepared, reads members_pkey and users_pkey. DepartmentHeadNamesTest pins the hint first in the statement for 1, 2 and 5 ids.

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