magicsethM
Convex Community2y ago
9 replies
magicseth

Unexpected Database Bandwidth Usage

Howdy team, I've got a query that is consuming A LOT of bandwidth.
It's a pretty simple query, and I call other functions equivalently frequently without the huge bandwidth cost.



const shrimpWorth = v.object({
  url: v.string(),
  count: v.number(),
  userId: v.id("users"),
});

export const getShrimpCountForResource = queryWithUser(({ db, user }, { url }) => {
  return db
    .query("shrimpWorth")
    .withIndex("by_url_user", (q) => q.eq("url", url).eq("userId", user._id))
    .first();
});
image.png
image.png
Was this page helpful?