Skip to content

Commit 13a782b

Browse files
authored
docs(billing): scope the usage_log workspace index note to created_at windows (#9479)
* docs(billing): scope the usage_log workspace index note to created_at windows * docs(billing): limit the workspace index note to the reads it covers
1 parent 0b26514 commit 13a782b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎apps/sim/lib/billing/core/usage-analytics-queries.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ import type { DbClient } from '@/lib/db/types'
2727
* and the member/source breakdowns are index-only. `workspace_id`, `workflow_id`,
2828
* `description`, `metadata`, and `execution_id` are NOT in it, so the remaining
2929
* reads heap-fetch per row — which is why they are issued only for the dimension
30-
* actually being viewed. A read narrowed to one workspace runs on
31-
* `usage_log_workspace_created_at_cost_idx` instead, which also covers `workflow_id`.
30+
* actually being viewed. Narrowed to one workspace over a `created_at` window (a range
31+
* or a reporting period), the totals, the series, and the member, source and workflow
32+
* breakdowns are index-only on `usage_log_workspace_created_at_cost_idx` instead, which
33+
* also covers `workspace_id` and `workflow_id`; the model breakdowns still heap-fetch,
34+
* and a Stripe-period drill-down matches the period stamps, which that index lacks.
3235
*/
3336

3437
export interface UsageTimeSeriesRow {

0 commit comments

Comments
 (0)