Summary
Several API endpoints execute multiple serial count and list queries that can likely be consolidated.
Evidence
- issues separate queries for paged L2 results, total L2 count, unclustered groups, unclustered count, total image count, and total L1 count.
- , , and follow the common pattern in separate round trips.
Why this matters
These extra round trips add latency on high-traffic list endpoints and make the API layer harder to optimize consistently.
Suggested direction
- Audit list endpoints for avoidable count queries and repeated summary lookups
- Consolidate counts where practical, or compute them in a dedicated service/query object
- Benchmark before/after on representative data volumes
Summary
Several API endpoints execute multiple serial count and list queries that can likely be consolidated.
Evidence
Why this matters
These extra round trips add latency on high-traffic list endpoints and make the API layer harder to optimize consistently.
Suggested direction