Dataset Locations

This page explains the concept of data location and the different locations where you can create datasets. To learn how to set the location for your dataset, see Creating and Using Datasets.

For information on regional pricing for BigQuery, see the Pricing page.

Key concepts

You specify a location for storing your BigQuery data when you create a dataset. After you create the dataset, the location cannot be changed.

There are two types of locations:

  • A regional location is a specific geographic place, such as Tokyo. For more information, see Regional resources on the Geography and Regions page.

  • A multi-regional location is a large geographic area, such as the United States, that contains at least two geographic places. For more information, see Multi-regional resources on the Geography and Regions page.

BigQuery stores your data in the selected location in accordance with the Service Specific Terms.

Regional locations

Region Name Region Description
Asia
asia-northeast1 Tokyo
australia-southeast1 Sydney
asia-southeast1 Singapore
Europe
europe-west2 London

Multi-regional locations

Multi-Region Name Multi-Region Description
EU European Union
US United States

Currently, you cannot select an individual region in the US or the EU.

Specifying your location

When loading data, querying data, or exporting data, BigQuery determines the location to run the job based on the datasets referenced in the request. For example, if a query references a table in a dataset stored in the asia-northeast1 region, the query job will run in that region. If a query does not reference any tables or other resources contained within datasets, and no destination table is provided, the query job will run in the location of the project's flat-rate reservation. If the project does not have a flat-rate reservation, the job runs in the US region. If more than one flat-rate reservation is associated with the project, the location of the reservation with the largest number of slots is where the job runs.

To specify the location to run a job explicitly:

  • When you query data using the BigQuery web UI, click Show Options, and for Processing Location, click Unspecified and choose your data's location.
  • When you use the command-line tool, supply the --location global flag and set the value to your location.
  • When you use the API, specify your region in the location property in the jobReference section of the job resource.

BigQuery returns an error if the specified location does not match the location of the datasets in the request.

Location considerations

When you choose a location for your data, consider the following:
  • Colocate your BigQuery dataset and your external data source.
    • When you query data in an external data source such as Cloud Storage, the data you're querying must be in the same location as your BigQuery dataset. For example, if your BigQuery dataset is in the EU multi-regional location, the Cloud Storage bucket containing the data you're querying must be in a multi-regional bucket in the EU. If your dataset is in the US multi-regional location, your Cloud Storage bucket must be in a multi-regional bucket in the US.
    • If your dataset is in a regional location, the Cloud Storage bucket containing the data you're querying must be in a regional bucket in the same location. For example, if your dataset is in the Tokyo region, your Cloud Storage bucket must be a regional bucket in Tokyo.
    • If your external dataset is in Cloud Bigtable, your dataset must be in the US or the EU multi-regional location. Your Cloud Bigtable data must be in one of the supported Cloud Bigtable locations.
    • Location considerations do not apply to Google Drive external data sources.
  • Colocate your Cloud Storage buckets for loading data.
    • If your BigQuery dataset is in a multi-regional location, the Cloud Storage bucket containing the data you're loading must be in a regional or multi-regional bucket in the same location. For example, if your BigQuery dataset is in the EU, the Cloud Storage bucket must be in a regional or multi-regional bucket in the EU.
    • If your dataset is in a regional location, your Cloud Storage bucket must be a regional bucket in the same location. For example, if your dataset is in the Tokyo region, your Cloud Storage bucket must be a regional bucket in Tokyo.
    • Exception: If your dataset is in the US multi-regional location, you can load data from a Cloud Storage bucket in any regional or multi-regional location.
  • Colocate your Cloud Storage buckets for exporting data.
    • When you export data, the regional or multi-regional Cloud Storage bucket must be in the same location as the BigQuery dataset. For example, if your BigQuery dataset is in the EU multi-regional location, the Cloud Storage bucket containing the data you're exporting must be in a regional or multi-regional location in the EU.
    • If your dataset is in a regional location, your Cloud Storage bucket must be a regional bucket in the same location. For example, if your dataset is in the Tokyo region, your Cloud Storage bucket must be a regional bucket in Tokyo.
    • Exception: If your dataset is in the US multi-regional location, you can export data into a Cloud Storage bucket in any regional or multi-regional location.
  • Develop a data management plan.
For more information on Cloud Storage locations, see Bucket Locations in the Cloud Storage documentation.

Moving BigQuery data between locations

You cannot change the location of a dataset after it is created. Also, you cannot move a dataset from one location to another. If you need to move a dataset from one location to another, follow this process:

  1. Export the data from your BigQuery tables to a regional or multi-region Cloud Storage bucket in the same location as your dataset. For example, if your dataset is in the EU multi-region location, export your data into a regional or multi-region bucket in the EU.

    There are no charges for exporting data from BigQuery, but you do incur charges for storing the exported data in Cloud Storage. BigQuery exports are subject to the limits on export jobs.

  2. Copy or move the data from your Cloud Storage bucket to a regional or multi-region bucket in the new location. For example, if you are moving your data from the US multi-region location to the Tokyo regional location, you would transfer the data to a regional bucket in Tokyo. For information on transferring Cloud Storage objects, see Renaming, Copying, and Moving Objects in the Cloud Storage documentation.

    Note that transferring data between regions incurs network egress charges in Cloud Storage.

  3. After you transfer the data to a Cloud Storage bucket in the new location, create a new BigQuery dataset (in the new location). Then, load your data from the Cloud Storage bucket into BigQuery.

    You are not charged for loading the data into BigQuery, but you will incur charges for storing the data in Cloud Storage until you delete the data or the bucket. You are also charged for storing the data in BigQuery after it is loaded. Loading data into BigQuery is subject to the limits on load jobs.

For more information on using Cloud Storage to store and move large datasets, see Using Google Cloud Storage with Big Data.

Next steps

¿Te sirvió esta página? Envíanos tu opinión:

Enviar comentarios sobre…

¿Necesitas ayuda? Visita nuestra página de asistencia.