Analyze the different metered costs for a particular SKU
Inspect the result, its parameters and the SQL behind it.
- Source
- FOCUS use-case library
- Data
- FOCUS 1.0 sample
- Status
- Adapted to v1.0
- Mode
- Read-only
- Library snapshot (UTC)
- 2026-10-08
- Source
- FOCUS 1.0 sample
- Result rows
- 32
- Status
- Adapted to v1.0
- Execution
- Precomputed
- Result snapshot (UTC)
- 2026-10-11
Column adaptations (1)
SKU list cost by price tier
32 rows. Scroll inside the table to see more.
Inspect Postgres SQL and original FOCUS SQL
Postgres SQL, as run
select provider_name as provider_name,
charge_period_start as charge_period_start,
charge_period_end as charge_period_end,
sku_price_id as sku_price_id,
pricing_unit as pricing_unit,
list_unit_price as list_unit_price,
sum(pricing_quantity) as total_pricing_quantity,
sum(list_cost) as total_list_cost,
sum(effective_cost) as total_effective_cost
from focus.cost_and_usage
where charge_period_start >= $1::timestamptz
and charge_period_end < $2::timestamptz
and sku_id = $3::text
group by provider_name, charge_period_start, charge_period_end, sku_price_id, pricing_unit, list_unit_price
order by charge_period_start, total_effective_cost desc nulls last, sku_price_id nulls last, list_unit_price nulls last
limit 500Original FOCUS SQL
SELECT ProviderName, ChargePeriodStart, ChargePeriodEnd, SkuMeter, SkuPriceId, PricingUnit, ListUnitPrice, SUM(PricingQuantity) AS TotalPricingQuantity, SUM(ListCost) AS TotalListCost, SUM(EffectiveCost) AS TotalEffectiveCost FROM focus_data_table WHERE ChargePeriodStart >= ? and ChargePeriodEnd < ? AND SkuId = ? GROUP BY ProviderName, ChargePeriodStart, ChargePeriodEnd, SkuMeter, SkuPriceId, PricingUnit, ListUnitPrice ORDER BY TotalEffectiveCost DESC