Paradaux
IssuesPAR-130Done
0

Cache /market aggregates + drop needless countAccounts join

Follow-ups from the same Faro review as PAR-129.

/market TTFB p50 ≈ 1.8s on every load (not just a tail). app/market/page.tsx runs 5 queries uncached; three are all-time full-table scans of chestshop_sale with no WHERE — countSales COUNT(*), sumVolume SUM(total_price), countDistinctItems COUNT(DISTINCT item_key). Fix: wrap the per-days bundle in unstable_cache({ revalidate: 60 }), mirroring the dashboard (app/page.tsx).

countAccounts (lib/sql/ledger.ts) keeps a LEFT JOIN firm_players even when there's no text query (the join is only needed for the q name filter). Make it conditional, same fix already applied to countTransactions in PAR-129.

Out of scope / flagged: /accounts list shows INP p90 ≈ 10s (client-side interaction jank) but only n=5 samples and no obvious culprit — needs more telemetry before touching.

Comments

No comments yet.

Activity

  • ParadauxIO linked a pull request — PR #9 open — Release economy-explorer → main (perf fixes + 1.1.0 RBAC/RUM)Jun 7, 2026, 7:36 PM
  • ParadauxIO linked a commit — Commit 7ccc3c7 — Cache /market aggregates; drop needless countAccounts join (PAR-130)Jun 7, 2026, 7:14 PM
  • ParadauxIO changed status to Status → DoneJun 7, 2026, 7:14 PM
  • ParadauxIO linked a pull request — PR #9 merged — Release economy-explorer → main (perf fixes + 1.1.0 RBAC/RUM)Jun 7, 2026, 7:14 PM
  • ParadauxIO linked a pull request — PR #9 open — Release economy-explorer → main (perf fixes + 1.1.0 RBAC/RUM)Jun 7, 2026, 7:10 PM
  • ParadauxIO linked a pull request — PR #9 open — Release economy-explorer → main (perf fixes + 1.1.0 RBAC/RUM)Jun 7, 2026, 7:06 PM
  • ParadauxIO linked a commit — Commit 7ccc3c7 — Cache /market aggregates; drop needless countAccounts join (PAR-130)Jun 7, 2026, 7:05 PM
  • tesks changed status to Status → Pending ReleaseJun 7, 2026, 6:55 PM
  • tesks created the issueJun 7, 2026, 6:54 PM