SELECT
sku.description as sku_description,
system_labels.value as machine_spec,
SUM(cost) as cost
FROM `project.dataset.table`
LEFT JOIN UNNEST(system_labels) as system_labels
ON system_labels.key = "compute.googleapis.com/machine_spec"
WHERE CAST(DATETIME(usage_start_time, "America/Los_Angeles") AS DATE) >= "2018-09-18"
GROUP BY sku_description, machine_spec;
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],[],[],[],null,["# Resource-based pricing\n======================\n\nBefore October 1st, 2018, machine type [SKUs](/skus) included vCPUs and memory\nas a single unit. Starting October 1st 2018, most machine types are billed as\nindividual vCPU and memory SKUs. The `n1-standard`, `n1-highmem`, and\n`n1-highcpu` machine types are billed by their individual vCPU and memory\nusage in two separate SKUs rather than billing by each machine type.\n\nThis change provides additional savings and simplicity.\n[Predefined machine types](/compute/docs/machine-resource) continue to function\nas normal, but your bill reports them as individual vCPUs and memory. This\nmeans that the savings for\n[sustained use discounts](/compute/docs/sustained-use-discounts) are no longer\nlimited to instances of the same machine type. Instead, you receive sustained\nuse discounts for instances based on your use of the individual vCPUs and GB\nof memory regardless of the machine type that you use. This additional\nflexibility provides larger sustained use discount savings than the\ncurrent billing model.\n\nSee the pricing for vCPUs and memory on the\n[Compute Engine pricing](/compute/vm-instance-pricing) page.\n\nSKUs for predefined vCPU and memory\n-----------------------------------\n\nBecause predefined machine types were not previously billed as individual\nvCPU and memory resources, several SKUs are added to describe those items. \n\nPricing\n-------\n\nTo see the pricing for the vCPUs and memory in different machine type\ncategories, see the [Compute Engine pricing](/compute/vm-instance-pricing)\npage.\n\nSustained use discounts\n-----------------------\n\nSustained use discounts for predefined machine types function the same\nway that they do for custom machine types and sole-tenant nodes. See\n[Sustained use discounts](/compute/docs/sustained-use-discounts) for\nexamples of sustained use discounts for resource based pricing.\n\nBilling export\n--------------\n\nWith this change, you are no longer be to see the machine types that you\nare using in your invoice and\n[Billing BigQuery export](/billing/docs/how-to/export-data-bigquery).\nHowever,\nyou can still use the `\"key\":\"compute.googleapis.com/machine_spec\"` system\nlabel key in billing BigQuery export to obtain the machine types\nfor the VMs\nthat you are using.\n\nFor example, you can find costs since 18 September 2018 sorted by machine type\nusing the following example: \n\n SELECT\n sku.description as sku_description,\n system_labels.value as machine_spec,\n SUM(cost) as cost\n FROM `project.dataset.table`\n LEFT JOIN UNNEST(system_labels) as system_labels\n ON system_labels.key = \"compute.googleapis.com/machine_spec\"\n WHERE CAST(DATETIME(usage_start_time, \"America/Los_Angeles\") AS DATE) \u003e= \"2018-09-18\"\n GROUP BY sku_description, machine_spec;\n\nReplace `project_id.dataset_name.table_name` with your own exported table.\n\nWhat's next\n-----------\n\n- Read the [Compute Engine documentation](/compute/docs).\n- Get started with [Compute Engine](/compute/docs/quickstarts).\n- Try the [Pricing calculator](/products/calculator).\n- Learn about [Compute Engine solutions and use cases](/architecture?text=Compute Engine).\n- Read [VM instance pricing](/compute/vm-instance-pricing) to see vCPU and memory pricing.\n- Read [Sustained use discounts](/compute/docs/sustained-use-discounts) to see the current process for sustained use discounts.\n\n#### Request a custom quote\n\nWith Google Cloud's pay-as-you-go pricing, you only pay for the services you use. Connect with our sales team to get a custom quote for your organization.\n[Contact sales](/contact?direct=true)"]]