Skip to content

Reduce redundant database round trips in list and summary API endpoints #60

Description

@masa-57

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestperformancePerformance improvementpriority:mediumUseful improvement with moderate urgency

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions