Overview of BigQuery pricing
BigQuery is a serverless data analytics platform. You don't need to provision individual instances or virtual machines to use BigQuery. Instead, BigQuery automatically allocates computing resources as you need them. You can also reserve compute capacity ahead of time in the form of slots, which represent virtual CPUs. The pricing structure of BigQuery reflects this design.
BigQuery pricing has two main components:
Analysis pricing is the cost to process queries, including SQL queries, user-defined functions, scripts, and certain data manipulation language (DML) and data definition language (DDL) statements that scan tables.
Storage pricing is the cost to store data that you load into BigQuery.
Each project that you create has a billing account attached to it. Any charges incurred by BigQuery jobs run in the project are billed to the attached billing account. BigQuery storage charges are also billed to the attached billing account. You can view BigQuery costs and trends by using the Cloud Billing reports page in the Cloud Console.
Analysis pricing models
BigQuery offers a choice of two pricing models for running queries:
On-demand pricing. With this pricing model, you are charged for the number of bytes processed by each query. The first 1 TB of query data processed per month is free.
Flat-rate pricing. With this pricing model, you purchase slots, which are virtual CPUs. When you buy slots, you are buying dedicated processing capacity that you can use to run queries. Slots are available in the following commitment plans:
- Flex slots: You commit to an initial 60 seconds.
- Monthly: You commit to an initial 30 days.
- Annual: You commit to 365 days.
With monthly and annual plans, you receive a lower price in exchange for a longer-term capacity commitment.
You can combine both models to fit your needs. With on-demand pricing, you pay for what you use. However, your queries run using a shared pool of slots, so performance can vary. With flat-rate pricing, you purchase guaranteed capacity, with a discounted price for a longer-term commitment. For more information about which pricing to choose for your workloads, see Workload management using Reservations.
On-demand analysis pricing
By default, queries are billed using the on-demand pricing model.
With on-demand pricing, BigQuery charges for the number of bytes processed (also referred to as bytes read). You are charged for the number of bytes processed whether the data is stored in BigQuery or in an external data source such as Cloud Storage, Drive, or Cloud Bigtable. On-demand pricing is based solely on usage.
On-demand query pricing is as follows:
Flat-rate pricing is also available for high-volume customers that prefer a stable, monthly cost.
Note the following regarding on-demand query charges:
- BigQuery uses a columnar data structure. You're charged according to the total data processed in the columns you select, and the total data per column is calculated based on the types of data in the column. For more information about how your data size is calculated, see Data size calculation.
- You aren't charged for queries that return an error or for queries that retrieve results from the cache. For script jobs this consideration is provided at a per-statement level.
- Charges are rounded up to the nearest MB, with a minimum 10 MB data processed per table referenced by the query, and with a minimum 10 MB data processed per query.
- Canceling a running query job might incur charges up to the full cost for the query if you let the query run to completion.
- When you run a query, you're charged according to the data processed in the
columns you select, even if you set an explicit
LIMITon the results.
- Partitioning and clustering your tables can help reduce the amount of data processed by queries. As a best practice, use partitioning and clustering whenever possible.
- On-demand query pricing is referred to as analysis pricing on the Google Cloud SKUs page.
- When you run a query against a clustered table, and the query includes a filter on the clustered columns, BigQuery uses the filter expression to prune the blocks scanned by the query. This can reduce the number of scanned bytes.
- When querying an external data source from BigQuery, you are charged for the number of bytes read by the query. If the external data is stored in another Google Cloud product such as Cloud Storage, any storage costs for that product apply as well. For more information, see Google Cloud pricing.
BigQuery provides cost control mechanisms that enable you to cap your query costs. You can set:
For detailed examples of how to calculate the number of bytes processed, see Query size calculation.
BigQuery offers flat-rate pricing for customers who prefer a stable cost for queries rather than paying the on-demand price per TB of data processed.
To enable flat-rate pricing, use BigQuery Reservations.
When you enroll in flat-rate pricing, you purchase dedicated query processing capacity, measured in BigQuery slots. Your queries consume this capacity, and you are not billed for bytes processed. If your capacity demands exceed your committed capacity, BigQuery will queue up slots, and you will not be charged additional fees. For more information about how BigQuery leverages slots for query processing, see Slots.
- Applies to query costs, including BigQuery ML, DML, and DDL statements.
- Does not apply to storage costs or BI Engine costs.
- Is purchased as a regional resource. Slot commitments purchased in one region or multi-region cannot be used in another region or multi-region and cannot be moved.
- Allows customers to raise per-project concurrency quotas by contacting Google Cloud Support.
- Is available in per-second, monthly, and annual commitments.
- Can be shared across your entire organization. There is no need to buy slot commitments for every project.
- Has a 100-slot minimum and is purchased in increments of 100 slots.
- Is billed per second for the duration of your commitment.
Monthly flat-rate commitments
The following table shows the cost of your monthly slot commitment. For more information, see Monthly commitments.
Annual flat-rate commitments
The following table shows the cost of your annual slot commitment. For more information, see Annual commitments.
Flex slots: short-term commitments
Flex slots are a special commitment type:
- Commitment duration is only 60 seconds.
- You can cancel Flex slots any time thereafter.
- You are charged only for the seconds your commitment was deployed.
Flex slots are subject to capacity availability. When you attempt to purchase Flex Slots, success of this purchase is not guaranteed. However, once your commitment purchase is successful, your capacity is guaranteed until you cancel it. For more information, see Flex slots.
The following table shows the cost of your Flex slot commitment.
Storage pricing is the cost to store data that you load into BigQuery. You pay for active storage and long-term storage.
Active storage includes any table or table partition that has been modified in the last 90 days.
Long-term storage includes any table or table partition that has not been modified for 90 consecutive days. The price of storage for that table automatically drops by approximately 50%. There is no difference in performance, durability, or availability between active and long-term storage.
The first 10 GB of storage per month is free.
Storage pricing is based on the amount of data stored in your tables when it is uncompressed. The size of the data is calculated based on the data types of the individual columns. For a detailed explanation of how data size is calculated, see Data size calculation.
Storage pricing is prorated per MB, per second. For example, if you store:
- 100 MB for half a month, you pay $0.001 (a tenth of a cent)
- 500 GB for half a month, you pay $5
- 1 TB for a full month, you pay $20
Storage usage is calculated in gigabytes (GB), where 1 GB is 230 bytes. This unit of measurement is also known as a gibibyte (GiB). Similarly, 1 TB is 240 bytes (1,024 GB).
If a table is not edited for 90 consecutive days, it is billed at the long- term storage rate. There is no degradation of performance, durability, availability, or any other functionality when a table is considered long-term storage.
Each partition of a partitioned table is considered separately for long-term storage pricing. If a partition hasn't been modified in the last 90 days, the data in that partition is considered long term storage and is charged at the discounted price.
If the table is edited, the price reverts back to the regular storage pricing, and the 90-day timer starts counting from zero. Anything that modifies the data in a table resets the timer, including:
|Loading data into a table||Any load or query job that appends data to a destination table or overwrites a destination table.|
|Copying data into a table||Any copy job appends data to a destination table or overwrites a destination table.|
|Writing query results to a table||Any query job that appends data to a destination table or overwrites a destination table.|
|Using data manipulation language (DML)||Using a DML statement to modify table data.|
|Using data definition language (DDL)||Using a
|Streaming data into the table||Ingesting data using the
All other actions do not reset the timer, including the following:
- Querying a table
- Creating a view that queries a table
- Exporting data from a table
- Copying a table (to another destination table)
- Patching or updating a table resource
For tables that reach the 90-day threshold during a billing cycle, the price is prorated accordingly.
Long-term storage pricing applies only to BigQuery storage, not to data stored in external data sources such as Cloud Bigtable, Cloud Storage, and Drive.
Data size calculation
When you load data into BigQuery or query the data, you're charged according to the data size. Data size is calculated based on the size of each column's data type.
The size of your stored data, and the size of the data processed by your queries is calculated in gigabytes (GB), where 1 GB is 230 bytes. This unit of measurement is also known as a gibibyte (GiB). Similarly, 1 TB is 240 bytes (1,024 GB).
The size of BigQuery's data types is as follows:
||2 bytes + the UTF-8 encoded string size|
||2 bytes + the number of bytes in the value|
||0 bytes + the size of the contained fields|
||16 bytes + 24 bytes * the number of vertices in the geography type. To verify the number of vertices, use the
Null values for any data type are calculated as 0 bytes.
A repeated column is stored as an array, and the size is calculated based on the
number of values. For example, an integer column (
that is repeated (
ARRAY<INT64>) and contains 4 entries is
calculated as 32 bytes (4 entries x 8 bytes).
Data ingestion pricing
BigQuery offers two modes of data ingestion:
Batch loading. Load the source data into one or more BigQuery tables in a single batch operation.
Streaming. Stream data one record at a time or in small batches.
For more information about which mode to choose, see Introduction to loading data.
By default, you are not charged for batch loading data from Cloud Storage or from local files into BigQuery. Load jobs by default use a shared pool of slots. BigQuery does not make guarantees about the available capacity of this shared pool or the throughput you will see. Alternatively, you can purchase dedicated slots to run load jobs. You are charged flat-rate pricing for dedicated slots. When load jobs are assigned to a reservation, they lose access to the free pool. For more information, see Assignments.
Once your data is loaded into BigQuery, it is subject to BigQuery storage pricing. If you load data from Cloud Storage, you are charged for storing the data in Cloud Storage. For details, see Data storage on the Cloud Storage pricing page.
If the target dataset is located in the
US multi-region, you are
not charged for network egress when loading from a Cloud Storage bucket
in any other region. For more information, see
Data extraction pricing
BigQuery offers two modes of data extraction:
Batch export. Export table data to Cloud Storage.
Streaming reads. Use the Storage Read API to perform streaming reads of table data.
By default, you are not charged for exporting data from BigQuery. Export jobs by default use a shared pool of slots. BigQuery does not make guarantees about the available capacity of this shared pool or the throughput you will see. Alternatively, you can purchase dedicated slots to run export jobs. You are charged flat-rate pricing for dedicated slots. When export jobs are assigned to a reservation, they lose access to the free pool. For more information, see Assignments.
Storage Read API pricing
The Storage Read API has an on-demand pricing model. You are charged for the data that you read. Customers enrolled in flat-rate pricing can use the Storage Read API to read up to 300 TB of data per month per billing account at no charge. Reads in excess of 300 TB per month are billed at the on-demand rate.
Under on-demand pricing, your Storage Read API charges are based on
the number of bytes read from BigQuery storage by calls to
The number of bytes read includes data used for filtering but not returned to
you as output from
ReadRows. You are not charged for data read from
Note the following regarding Storage Read API charges:
- You are charged according to the total amount of data read. The total data read per column is calculated based on the type of data in the column, and the size of the data is calculated based on the column's data type. For a detailed explanation of how data size is calculated, see Data size calculation.
- You are charged for any data read in a read session even if a
- If you cancel a
ReadRowscall before the end of the stream is reached, you are charged for any data read before the cancellation. Your charges can include data that was read but not returned to you before the cancellation of the
- As a best practice, use partitioned and clustered tables whenever possible.
You can reduce the amount of data read by using a
WHEREclause to prune partitions. For more information, see Querying partitioned tables.
- The Storage Read API is not included in the Google Cloud Free Tier.
The following BigQuery operations are free of charge in every location. Quotas and limits apply to these operations.
|Loading data||Free using the shared slot pool. Customers can choose flat-rate pricing for guaranteed capacity. Once the data is loaded into BigQuery, you are charged for storage. For details, see Data ingestion pricing.|
|Copying data||You are not charged for copying a table, but you do incur charges for storing the new table and the table you copied. For more information, see Copying an existing table.|
|Exporting data||Free using the shared slot pool, but you do incur charges for storing the data in Cloud Storage. For details, see Exporting data.|
|Deleting datasets||You are not charged for deleting a dataset.|
|Deleting tables, views, partitions, and functions||You are not charged for deleting a table, deleting a view, deleting individual table partitions, or deleting a user-defined function.|
|Metadata operations||You are not charged for list, get, patch, update and delete calls. Examples include (but are not limited to): listing datasets, updating a dataset's access control list, updating a table's description, or listing user-defined functions in a dataset.|
|Reading pseudo columns||You are not charged for querying the contents of the following pseudo columns:
|Reading meta tables||You are not charged for querying the contents of the following meta tables:
|User-defined functions (UDFs)||You are not charged for creating, replacing, or invoking persistent UDFs.|
Free usage tier
As part of the Google Cloud Free Tier, BigQuery offers some resources free of charge up to a specific limit. These free usage limits are available during and after the free trial period. If you go over these usage limits and are no longer in the free trial period, you will be charged according to the pricing on this page.
|Resource||Monthly free usage limits||Details|
|Storage||The first 10 GB per month is free.||BigQuery ML models and training data stored in BigQuery are included in the BigQuery storage free tier.|
|Queries (analysis)||The first 1 TB of query data processed per month is free.||Queries that use BigQuery ML prediction, inspection, and
evaluation functions are included in the BigQuery analysis free
tier. BigQuery ML queries that contain
BigQuery flat-rate pricing is also available for high-volume customers that prefer a stable, monthly cost.
|BigQuery Storage Write API (Preview)||The first 2 TB per month are free.||For more information, see Data ingestion pricing.|
||The first 10 GB of data processed by queries that contain
For information on analyzing billing data using reports, see View your billing reports and cost trends.
For information on analyzing your billing data in BigQuery, see Export Cloud Billing data to BigQuery.
For information about estimating costs, see Estimating storage and query costs.