Usage and Billing View

sys.information_schema.instance_usage is a system view in Singdata Lakehouse that records resource consumption and billing details at the instance level. Each row represents the consumption of one SKU during a single billing period (hourly or daily), making it the primary source for bill reconciliation, cost attribution, and usage trend analysis.

Data is retained from instance creation onward.


Field Reference

FieldTypeDescription
account_idintAccount ID
account_namestringAccount name (i.e. the instance name)
instance_idintInstance ID
region_namestringCloud region, e.g. Alibaba Cloud - East China 2 (Shanghai)
sku_categorystringSKU category — see classification table below
sku_namestringSpecific SKU name
workspace_idstringWorkspace ID
workspace_namestringWorkspace name
measurement_starttimestampStart of the billing period
measurement_endtimestampEnd of the billing period
measurements_unitstringUnit of measurement, e.g. yuan/cru, yuan/GiB/day, yuan/gb, M Tokens
measurements_consumptiondoubleActual consumption during the period (in the given unit)
price_ratestringUnit price as a string, e.g. "0.020000"
amountdoubleGross amount before discount (consumption × unit price)
discount_ratedoubleDiscount rate: 1 means no discount, 0.8 means 20% off
total_after_discountdoubleNet amount after discount (the actual billed amount)

SKU Categories

sku_categorysku_name examplesDescription
computeGP Virtual Cluster, AP Virtual Cluster, Integration Virtual Cluster, Bulk Ingestion, Stream Ingestion, IGS Service, Task SchedulingCompute resource consumption, unit: yuan/cru
storageManaged Storage, Retained Managed Storage, Job Temp Storage, Managed User Volume StorageStorage usage, unit: yuan/GB/day or yuan/GiB/day
networkQuery Internet Data TransferPublic internet egress, unit: yuan/gb
aiAI model calls (multiple models, input/output billed separately)AI function consumption, unit: M Tokens

Query Examples

Total cost by SKU category over the last 7 days

SELECT sku_category, SUM(measurements_consumption) AS total_consumption, SUM(amount) AS amount_before_discount, SUM(total_after_discount) AS total_cost FROM sys.information_schema.instance_usage WHERE measurement_start >= CURRENT_DATE() - INTERVAL 7 DAYS GROUP BY sku_category ORDER BY total_cost DESC;

Monthly cost ranking by workspace

SELECT workspace_name, SUM(total_after_discount) AS total_cost FROM sys.information_schema.instance_usage WHERE measurement_start >= DATE_TRUNC('month', CURRENT_DATE()) GROUP BY workspace_name ORDER BY total_cost DESC;

Daily cost trend for a specific workspace

SELECT DATE(measurement_start) AS date, sku_category, SUM(total_after_discount) AS daily_cost FROM sys.information_schema.instance_usage WHERE workspace_name = '<your_workspace>' AND measurement_start >= CURRENT_DATE() - INTERVAL 30 DAYS GROUP BY DATE(measurement_start), sku_category ORDER BY date DESC, daily_cost DESC;

CRU consumption breakdown for compute clusters

SELECT workspace_name, sku_name, DATE(measurement_start) AS date, measurements_consumption AS cru_hours, total_after_discount AS cost FROM sys.information_schema.instance_usage WHERE sku_category = 'compute' AND measurement_start >= CURRENT_DATE() - INTERVAL 7 DAYS ORDER BY date DESC, cost DESC;

Workspaces exceeding a storage threshold

SELECT workspace_name, sku_name, DATE(measurement_start) AS date, measurements_consumption AS storage_gib FROM sys.information_schema.instance_usage WHERE sku_category = 'storage' AND measurements_consumption > 100 AND measurement_start >= CURRENT_DATE() - INTERVAL 7 DAYS ORDER BY storage_gib DESC;

AI function token consumption

SELECT workspace_name, sku_name, SUM(measurements_consumption) AS total_tokens_m, SUM(total_after_discount) AS total_cost FROM sys.information_schema.instance_usage WHERE sku_category = 'ai' GROUP BY workspace_name, sku_name ORDER BY total_cost DESC;


Notes

  • storage SKUs are measured at daily granularity; all other categories are measured hourly.
  • Data is not real-time — there is approximately a 4-hour delay before records appear.
  • price_rate is a string type. Cast it before arithmetic: CAST(price_rate AS DOUBLE).
  • total_after_discount is the final billed amount. amount is the pre-discount gross. The difference is the discount applied.