[Performance] Batch tenant-summary providers across tenant list pages #273

Closed
opened 2026-07-29 13:25:51 +02:00 by zemion · 1 comment
Owner

Problem

Tenant lists are paginated and ordinary summaries now invoke only the Access, Campaign, and Files count providers. However, providers are still called once per tenant, so a page remains O(tenants x providers) at the capability boundary. Full deletion planning correctly invokes every registered provider and must keep that behavior.

Scope

Introduce an optional batched tenant-summary capability that accepts the tenant IDs in a page and returns counts keyed by tenant. Preserve compatibility for providers that only implement the single-tenant contract.

Acceptance criteria

  • Tenant list query/provider count is bounded by provider count, not tenant count.
  • Optional modules remain optional; Core does not import provider implementations.
  • Ordinary list and destructive deletion-plan semantics remain distinct.
  • Tests cover absent, single-item, batched, partial, and failing providers.
  • Representative query-count measurements are recorded before closure.
## Problem Tenant lists are paginated and ordinary summaries now invoke only the Access, Campaign, and Files count providers. However, providers are still called once per tenant, so a page remains O(tenants x providers) at the capability boundary. Full deletion planning correctly invokes every registered provider and must keep that behavior. ## Scope Introduce an optional batched tenant-summary capability that accepts the tenant IDs in a page and returns counts keyed by tenant. Preserve compatibility for providers that only implement the single-tenant contract. ## Acceptance criteria - Tenant list query/provider count is bounded by provider count, not tenant count. - Optional modules remain optional; Core does not import provider implementations. - Ordinary list and destructive deletion-plan semantics remain distinct. - Tests cover absent, single-item, batched, partial, and failing providers. - Representative query-count measurements are recorded before closure. <!-- tenant-summary-provider-batching-20260729 -->
Author
Owner

Codex State: done

Summary

  • Implemented and pushed optional manifest/registry batch providers and tenant_counts_many in Core af3e0a0, list-page consumption in Tenancy b40615f, and grouped providers in Access 6295cfa, Campaign 46df12c, and Files 632cc6c. Legacy single-tenant providers remain supported; deletion planning remains on the complete single-tenant path.

Verification

  • 100-tenant contract measurement: provider calls remain Access=1, Campaign=1, Files=1 instead of scaling to 300 callback invocations.
  • Database-backed statement measurement: Access=3, Campaign=1, Files=5, for 9 provider SQL statements per page instead of approximately 9 x tenant count (about 900 at page size 100).
  • Core tenant-summary + module-system tests: 123 passed; provider tests and Ruff checks pass in Access, Campaign, Files, and Tenancy; full devserver startup smoke passes.
## Codex State: done ### Summary - Implemented and pushed optional manifest/registry batch providers and tenant_counts_many in Core af3e0a0, list-page consumption in Tenancy b40615f, and grouped providers in Access 6295cfa, Campaign 46df12c, and Files 632cc6c. Legacy single-tenant providers remain supported; deletion planning remains on the complete single-tenant path. ### Verification - `100-tenant contract measurement: provider calls remain Access=1, Campaign=1, Files=1 instead of scaling to 300 callback invocations.` - `Database-backed statement measurement: Access=3, Campaign=1, Files=5, for 9 provider SQL statements per page instead of approximately 9 x tenant count (about 900 at page size 100).` - `Core tenant-summary + module-system tests: 123 passed; provider tests and Ruff checks pass in Access, Campaign, Files, and Tenancy; full devserver startup smoke passes.`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GovOPlaN/govoplan-core#273