diff --git a/apps/sim/lib/billing/core/usage-analytics-queries.ts b/apps/sim/lib/billing/core/usage-analytics-queries.ts index 8e075e18a77..9ca62ba8fa7 100644 --- a/apps/sim/lib/billing/core/usage-analytics-queries.ts +++ b/apps/sim/lib/billing/core/usage-analytics-queries.ts @@ -27,8 +27,11 @@ import type { DbClient } from '@/lib/db/types' * and the member/source breakdowns are index-only. `workspace_id`, `workflow_id`, * `description`, `metadata`, and `execution_id` are NOT in it, so the remaining * reads heap-fetch per row — which is why they are issued only for the dimension - * actually being viewed. A read narrowed to one workspace runs on - * `usage_log_workspace_created_at_cost_idx` instead, which also covers `workflow_id`. + * actually being viewed. Narrowed to one workspace over a `created_at` window (a range + * or a reporting period), the totals, the series, and the member, source and workflow + * breakdowns are index-only on `usage_log_workspace_created_at_cost_idx` instead, which + * also covers `workspace_id` and `workflow_id`; the model breakdowns still heap-fetch, + * and a Stripe-period drill-down matches the period stamps, which that index lacks. */ export interface UsageTimeSeriesRow {