KamoCRM

Eliminate full-table scan and N+1 queries on leads endpoint

Performancekamo-shared-library
Shipped
11 மார்ச், 2026 அன்று 6:48 PM UTC
Author
Kamo
Commit
5fc12c8

- LeadRepository: add findByOrganizationId JPQL query (uses ORG_ID index) instead of loading entire LEADS table and filtering in Java - LeadCustomFormDataRepository: add findByLeadIn for batch loading custom form data for multiple leads in one query - **************** use new repo query; batch-load vendor products with findAllById + map lookup instead of N findById calls - LeadService: add **************** for batch use by the controller For 100 leads this reduces DB queries from ~200 to 3.

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