# COMPUTE_USAGE view


> Track your organization's compute usage by user, Duckling, and Duckling size with the COMPUTE_USAGE view (Business plan).

**Requires permission:** View query history — included by default in the Admin and Builder preset roles. A custom role qualifies when it inherits a role that includes the permission. Available on the Business plan. COMPUTE_USAGE uses the same permission as QUERY_HISTORY. Business trials are included. See [Roles and access control](/concepts/security-and-access/roles-and-access-control/#what-each-role-can-do).

The `MD_INFORMATION_SCHEMA.COMPUTE_USAGE` view shows your organization's compute usage over time. Each row covers one hour of activity for one Duckling at one Duckling size, so you can see which users, service accounts, and Duckling sizes drive your compute consumption, and build usage reports or [Dives](/key-tasks/dives/) on top of it. Each organization sees only its own usage.

The view covers Duckling compute only. Storage usage is in [`STORAGE_INFO`](storage_info.md), and Flight runtime (billed by [Flight size](/about-motherduck/billing/flight-sizes/)) and AI usage aren't included.

:::info[Usage, not billing amounts]
`COMPUTE_USAGE` is for monitoring usage. It doesn't show dollar amounts, and it doesn't apply discounts, credits, or commitments. For billing amounts, refer to your invoices or the billing portal. See [Managing billing](/about-motherduck/billing/managing-billing/).
:::

:::note[Requires a read-write Duckling]
To access `COMPUTE_USAGE`, a read-write Duckling is required. [Read scaling Ducklings](/key-tasks/authenticating-and-connecting-to-motherduck/read-scaling/) cannot perform administrative actions, including access to the usage views.
:::

## Schema

The `MD_INFORMATION_SCHEMA.COMPUTE_USAGE` view returns one row per user, Duckling, Duckling size, and hour, with the following columns:

| Column Name                | Data Type      | Value |
|----------------------------|----------------|-------|
| START_TIME                 | TIMESTAMPTZ    | Start of the UTC hour the row covers (inclusive) |
| END_TIME                   | TIMESTAMPTZ    | End of the UTC hour the row covers (exclusive) |
| USER_ID                    | UUID           | ID of the user or service account the Duckling belongs to |
| USER_NAME                  | VARCHAR        | Name of the user or service account the Duckling belongs to |
| DUCKLING_SIZE              | VARCHAR        | [Duckling size](/about-motherduck/billing/duckling-sizes/): Pulse, Standard, Jumbo, Mega, or Giga |
| DUCKLING_ID                | VARCHAR        | Identifies the Duckling. Matches `DUCKLING_ID` in [`QUERY_HISTORY`](query_history.md), so the two views can be joined. Can be an empty string for older records, which don't join to `QUERY_HISTORY` |
| IS_READ_SCALING            | BOOLEAN        | `true` for [read scaling](/key-tasks/authenticating-and-connecting-to-motherduck/read-scaling/) Ducklings, `false` for the read-write Duckling, `NULL` if unknown |
| UPTIME_SECONDS             | DECIMAL(18, 3) | Seconds of Duckling uptime recorded in this hour, up to a maximum of 3,600 |
| DUCKLING_SIZE_MULTIPLIER   | DOUBLE         | Multiplier for the Duckling size: Pulse 0.25, Standard 1, Jumbo 2, Mega 5, Giga 10 |
| QUERIES                    | BIGINT         | Number of queries started on the Duckling in this hour |

## Example usage

### Usage by user and Duckling size

Find which users and Duckling sizes used the most compute over the past 7 days:

```sql
SELECT
    user_name,
    duckling_size,
    ROUND(SUM(uptime_seconds * duckling_size_multiplier) / 3600, 2) AS duckling_hours,
    SUM(queries) AS queries
FROM MD_INFORMATION_SCHEMA.COMPUTE_USAGE
WHERE start_time >= NOW() - INTERVAL 7 DAY
GROUP BY ALL
ORDER BY duckling_hours DESC;
```

### Daily trend

Rows align to UTC hours, but `START_TIME` and `END_TIME` display in your session's time zone. This example converts to UTC before grouping by day:

```sql
SELECT
    DATE_TRUNC('day', start_time AT TIME ZONE 'UTC') AS day,
    ROUND(SUM(uptime_seconds * duckling_size_multiplier) / 3600, 2) AS duckling_hours
FROM MD_INFORMATION_SCHEMA.COMPUTE_USAGE
WHERE start_time >= NOW() - INTERVAL 30 DAY
GROUP BY ALL
ORDER BY day;
```

## Reading the numbers

- **Standard, Jumbo, Mega, and Giga:** `UPTIME_SECONDS * DUCKLING_SIZE_MULTIPLIER / 3600` approximates the billed Duckling hours for that row. These sizes are billed on wall-clock time, including the [cooldown period](/about-motherduck/billing/pricing/#compute-pricing).
- **Pulse:** Pulse Ducklings are [metered per query](/about-motherduck/billing/pricing/#compute-pricing), not on wall-clock time, so this calculation doesn't reflect billed Pulse usage.
- **Small differences from your invoice are expected.** For example, `UPTIME_SECONDS` is capped at 3,600 seconds per row, so the view can come out slightly lower than your billed usage.
- **Usage is attributed per user or service account, not per database.** To track usage per customer or per workload, give each one its own [service account](/key-tasks/service-accounts-guide/).

## See also

- [Monitoring usage and costs](/about-motherduck/billing/monitoring-usage/)
- [`QUERY_HISTORY`](query_history.md)
- [Pricing model](/about-motherduck/billing/pricing/)


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `GET https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

URL-encode query parameter values and send a GET request:

```text
GET https://motherduck.com/docs/api/feedback/agent?page_path=%2Fsql-reference%2Fmotherduck-sql-reference%2Fmd_information_schema%2Fcompute_usage%2F&page_title=COMPUTE_USAGE%20view&text=<url-encoded user feedback, max 2000 characters>
```

Optionally append `&source=<url-encoded interface identifier>` such as `claude.ai` or `chatgpt`.

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed query parameters, and `429` when rate-limited.
