Skip to main content

Billing & Credits

Use Studio usage views and SQL metering commands to understand consumption. Your account agreement determines rates, included credits, storage charges, and billing mode. Examples in this reference do not define a pricing plan.

Compute Units​

Compute Units (CUs) express metered compute consumption. The effective billing mode matters: warehouse running time can include idle periods, while query-attribution records describe execution work. Read the billing mode returned by SHOW WAREHOUSE USAGE; do not assume every account bills only active query time.

Warehouse Size and CU Rates​

Warehouse sizes and rates are determined by the service and your account terms. Compare actual usage on representative workloads; a larger warehouse may finish sooner without reducing total consumption. Estimates do not guarantee a final charge.

EXPLAIN COST​

Before running an expensive query, use EXPLAIN COST to see estimated CU consumption across warehouse sizes:

EXPLAIN COST SELECT COUNT(*) FROM sales;

An illustrative response contains estimates by warehouse size, a scan summary, and the original query. Values below are not published rates:

warehouse_size | est_time_secs | est_cus | est_cost_usd | is_current | recommendation
Small | 0.1 | 0.0001 | 0.000111 | False |
Medium | 0.1 | 0.0001 | 0.000222 | True |
Large | 0.1 | 0.0002 | 0.000444 | False |
X-Large | 0.1 | 0.0004 | 0.000889 | False |
--- | 0.0 | 0.0 | 0.0 | False | Scan: 0.0 MB (1 files) | Rows: 8
Query | 0.0 | 0.0 | 0.0 | False | SELECT COUNT(*) FROM sales

is_current=True marks your current warehouse size. The recommendation row shows scan details (files, rows, shuffle bytes) and sizing advice.

This helps right-size the warehouse: smaller warehouses are cheaper per CU but slower; larger warehouses finish faster but cost more due to parallelism overhead. The sweet spot is typically where estimated CUs are lowest.

Resource Monitors​

Resource monitors set credit spending limits on warehouses and enforce them automatically. Each time usage is recorded (per-query compute-unit attribution or periodic warehouse metering), Gnok adds the credits to the monitor's total and checks its thresholds, without adding work to your queries.

Create a Resource Monitor​

CREATE RESOURCE MONITOR monthly_budget
WITH CREDIT_QUOTA = 1000
FREQUENCY = MONTHLY
TRIGGERS
ON 50 PERCENT DO NOTIFY
ON 80 PERCENT DO NOTIFY
ON 100 PERCENT DO SUSPEND;

Response:

Resource monitor 'monthly_budget' created (quota=1000 credits, frequency=MONTHLY,
triggers=[50% -> NOTIFY, 80% -> NOTIFY, 100% -> SUSPEND])

Trigger Actions​

ActionBehavior
NOTIFYRecords an alert in resource_monitor_alerts
SUSPENDRecords an alert, then sets the warehouse status to suspended — new queries are rejected

Each trigger fires once per billing period. When the period resets (daily/weekly/monthly), all triggers re-arm automatically.

Assign a Resource Monitor to a Warehouse​

ALTER WAREHOUSE analytics_wh SET RESOURCE_MONITOR = monthly_budget;

Response:

Warehouse 'analytics_wh' resource monitor set to 'monthly_budget'

This links the warehouse to the monitor. As queries run and billing records accumulate, the monitor's credits_used increments automatically. Dropping the monitor automatically unlinks it from the warehouse.

View Resource Monitors​

SHOW RESOURCE MONITORS;

Response:

monitor_name   | credit_quota | frequency | credits_used | triggers
monthly_budget | 1000 | MONTHLY | 42.5 | 50% -> NOTIFY, 80% -> NOTIFY, 100% -> SUSPEND

credits_used reflects real-time accumulated CUs since the last period reset.

Drop a Resource Monitor​

DROP RESOURCE MONITOR monthly_budget;
DROP RESOURCE MONITOR IF EXISTS monthly_budget;

Metering and Usage Queries​

Warehouse Usage​

View CU consumption and the effective billing mode for the current period:

SHOW WAREHOUSE USAGE;

Response:

metric                      | cus | cost_usd | detail
Billing Mode | 0.0 | 0.0 | STANDARD (CuMeter — warehouse running time)
Warehouse Compute (billing) | 0.0 | 0.0 | 44.000000 CUs
Query Execution | 0.0 | 0.0 | 0.016470 CUs (153 queries)
Idle Time | 0.0 | 0.0 | 43.983530 CUs (warehouse running, no queries)
--- | 0.0 | 0.0 |
Total Cost | 0.0 | 0.0 | $88.000000 at $2/CU
Queries Executed | 0.0 | 0.0 | 153
Bytes Scanned | 0.0 | 0.0 | 334859
Period | 0.0 | 0.0 | 2026-04-01 to 2026-04-04 UTC

This illustrative response shows billing mode, query versus idle consumption, and the period. Dollar amounts and rates shown are example data, not an offer or account quote.

Metering History​

View aggregated metering records:

SHOW METERING HISTORY;

Returns per-warehouse usage records with columns: warehouse_name, warehouse_size, record_type, cus_consumed, bytes_scanned, queries_executed, period_start.

Storage Costs​

Storage charges and included capacity follow your account terms and storage arrangement. Retained snapshots and unused data can contribute to storage usage. Review table maintenance and retention requirements before removing data.

Free Tier​

Gnok may offer a free tier to help new users explore the service. Availability, eligibility, included compute and storage, duration, and usage limits will be published when the offering is finalized. Until then, use the allowances shown for your account; do not assume a particular credit amount or access to every feature.

Cost Optimization Tips​

Right-size your warehouses​

Use EXPLAIN COST to find the warehouse size with the lowest estimated CU consumption. Larger is not always cheaper -- parallelism overhead can increase total CU cost even as wall-clock time drops.

Enable auto-suspend​

Warehouses should suspend after a short idle period to avoid billing for unused capacity:

ALTER WAREHOUSE analytics_wh SET
AUTO_SUSPEND = 300, -- seconds of idle before suspend
AUTO_RESUME = TRUE; -- resume automatically on next query

Use EXPLAIN COST before large queries​

For ad-hoc analytical queries, preview costs before execution. This is especially important for queries that scan large tables without selective filters.

Set resource monitors on all warehouses​

Even development warehouses should have resource monitors to prevent unexpected costs from runaway queries or forgotten sessions.

Schedule heavy workloads during off-peak hours​

Schedule work to avoid unnecessary concurrency and repeated execution. Do not assume time-of-day discounts unless they are part of your account terms.

Monitor usage regularly​

Review SHOW METERING HISTORY weekly. Look for warehouses with high CU consumption but low query counts (indicates oversized warehouses or long-running queries that could be optimized).

Further Reading​