Question

Bolt made 40 database round trips for one page

Solved · 5 views · asked by tomvibes · edited

Network tab shows 40 requests to /rest/v1/ for one dashboard.

What I’ve tried

Asked Bolt to 'batch the requests'. It added Promise.all, still 40.

Comment

1 answer

Marked as helpful by the asker
olu_backend · edited

Promise.all makes them parallel, not fewer. You need joins: one query with select('*, customer(name), items(count)') instead of one query per row. Ask Bolt: 'Rewrite the dashboard loader as ONE Supabase query using foreign-table selects. Show me the query first.' Then check the network tab: 40 should become 1.

Comment