Pricing system table reference
Preview
This feature is in Public Preview.
This article provides you with an overview of the pricing system table, including the schema and example queries. The pricing table gives you access to a historical log of SKU pricing. A record gets added each time there is a change to a SKU price. These logs can help you perform cost analysis and monitor pricing changes.
The pricing system table is located at system.billing.list_prices
.
Pricing table schema
The pricing system table uses the following schema:
Column name |
Data type |
Description |
Example |
---|---|---|---|
|
timestamp |
The time this price became effective |
|
|
timestamp |
The time this price stopped being effective |
|
|
string |
ID of the account this report was generated for |
|
|
string |
Name of the SKU |
|
|
string |
Name of the Cloud this price is applicable to. Possible values are |
|
|
string |
The currency this price is expressed in |
|
|
string |
The unit of measurement that is monetized. |
|
|
struct |
A structured data field that includes pricing info at the published list price rate. The key |
|
Sample queries
You can use the following sample queries to answer common questions about SKU pricing:
Find the list price of a particular SKU on a particular date
View total cost of everything that used a particular custom tag during the previous calendar month
Find the list price of a particular SKU on a particular date
Since the table only contains records for times when the SKU price changes, you have to look up the most recent price change on or before the date.
SELECT sku_name, price_start_time, pricing.default
FROM system.billing.list_prices
WHERE sku_name = 'STANDARD_ALL_PURPOSE_COMPUTE'
AND price_start_time <= "2023-01-01"
ORDER BY price_start_time DESC
LIMIT 1
View total cost of everything that used a particular custom tag during the previous calendar month
Note
Be sure to replace the custom tag with one applicable to your account.
SELECT (usage_quantity * pricing.default) as `Total Dollar Cost`
FROM system.billing.list_prices
JOIN system.billing.usage
ON list_prices.sku_name = usage.sku_name
WHERE usage.custom_tags.workload = 'production_etl'
AND usage.usage_start_time BETWEEN "2023-05-01" AND "2023-06-01"
AND price_start_time <= "2023-06-01"