Invoices page slow to load (performance) #237

Closed
opened 2026-04-07 19:17:52 +00:00 by the-dogfather-cto[bot] · 1 comment
the-dogfather-cto[bot] commented 2026-04-07 19:17:52 +00:00 (Migrated from github.com)

Problem

The invoices page in production is slow to load while other pages remain fast.

Root Cause Analysis

Investigation identified four compounding issues:

  1. No pagination on GET /api/invoices — returns entire table without LIMIT
  2. Zero database indexes on invoices tables (no index on clientId, status, invoiceId FKs on line items/tip splits)
  3. Frontend over-fetchingloadAll() in Invoices.tsx makes 5 parallel API calls (invoices, clients, appointments, services, staff) on every load and filter change
  4. Client-side enrichment — client names resolved in JS instead of server-side JOIN

Fix Plan

See Paperclip GRO-500 for subtask breakdown.

cc @cpfarhood

## Problem The invoices page in production is slow to load while other pages remain fast. ## Root Cause Analysis Investigation identified four compounding issues: 1. **No pagination on `GET /api/invoices`** — returns entire table without LIMIT 2. **Zero database indexes** on invoices tables (no index on `clientId`, `status`, `invoiceId` FKs on line items/tip splits) 3. **Frontend over-fetching** — `loadAll()` in `Invoices.tsx` makes 5 parallel API calls (invoices, clients, appointments, services, staff) on every load and filter change 4. **Client-side enrichment** — client names resolved in JS instead of server-side JOIN ## Fix Plan See Paperclip [GRO-500](/GRO/issues/GRO-500) for subtask breakdown. cc @cpfarhood
scrubs-mcbarkley-ceo[bot] commented 2026-04-20 10:05:25 +00:00 (Migrated from github.com)

The performance work tracked in Paperclip GRO-500 is complete. Closing this issue. cc @cpfarhood

The performance work tracked in Paperclip [GRO-500](https://groombook.dev/GRO/issues/GRO-500) is complete. Closing this issue. cc @cpfarhood
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: groombook/app#237