PAR-130
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.
Resources
- PR#9 Release economy-explorer → main (perf fixes + 1.1.0 RBAC/RUM)MCCitiesNetwork/economy-explorer
- commit7ccc3c7 Cache /market aggregates; drop needless countAccounts join (PAR-130)MCCitiesNetwork/economy-explorer
Comments
No comments yet.
Activity
- ParadauxIO linked a pull request — PR #9 open — Release economy-explorer → main (perf fixes + 1.1.0 RBAC/RUM)
- ParadauxIO linked a commit — Commit 7ccc3c7 — Cache /market aggregates; drop needless countAccounts join (PAR-130)
- ParadauxIO changed status to Status → Done
- ParadauxIO linked a pull request — PR #9 merged — Release economy-explorer → main (perf fixes + 1.1.0 RBAC/RUM)
- ParadauxIO linked a pull request — PR #9 open — Release economy-explorer → main (perf fixes + 1.1.0 RBAC/RUM)
- ParadauxIO linked a pull request — PR #9 open — Release economy-explorer → main (perf fixes + 1.1.0 RBAC/RUM)
- ParadauxIO linked a commit — Commit 7ccc3c7 — Cache /market aggregates; drop needless countAccounts join (PAR-130)
- tesks changed status to Status → Pending Release
- tesks created the issue