Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions apps/sim/lib/billing/core/usage-analytics-queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down