When querying CloudSQL from BigQuery in Google Cloud Platform (GCP), there are several pricing options available to consider. The pricing options for this specific scenario depend on the type of BigQuery table being used and the type of query being executed. In order to provide a comprehensive explanation, I will discuss the pricing options for both federated queries and standard queries separately.
For federated queries, where BigQuery accesses data stored in an external data source such as CloudSQL, the pricing is based on the amount of data processed by BigQuery. This includes both the data scanned in the external data source and the data processed by BigQuery during the query execution. The pricing is determined by the amount of data processed in the external data source, which is billed at the normal CloudSQL rates, and the amount of data processed by BigQuery, which is billed at the standard BigQuery rates. It is important to note that there might be additional costs associated with network egress if the CloudSQL instance and BigQuery are located in different regions.
For standard queries, where BigQuery uses native tables stored within BigQuery itself, the pricing is based on the amount of data processed by BigQuery during the query execution. In this case, the pricing is determined solely by the amount of data processed by BigQuery and is billed at the standard BigQuery rates. There are no additional costs for accessing CloudSQL in this scenario.
To provide a clear understanding of the pricing structure, let's consider an example. Suppose we have a CloudSQL instance with 100 GB of data and we execute a federated query from BigQuery that scans 10 GB of data in the CloudSQL instance. Additionally, during the query execution, BigQuery processes 1 GB of data. In this case, the pricing for the federated query would include the cost of scanning 10 GB of data in the CloudSQL instance, based on the CloudSQL pricing rates, and the cost of processing 1 GB of data in BigQuery, based on the standard BigQuery pricing rates. If the CloudSQL instance and BigQuery are located in different regions, there might be additional costs for network egress.
The pricing options for querying CloudSQL from BigQuery in GCP depend on the type of query being executed. For federated queries, the pricing is based on the amount of data processed by both CloudSQL and BigQuery, while for standard queries, the pricing is based solely on the amount of data processed by BigQuery. It is important to consider the data size, query complexity, and network egress costs when estimating the pricing for querying CloudSQL from BigQuery.
Other recent questions and answers regarding Examination review:
- What permissions do you need to grant to connection users in order to query Cloud SQL from BigQuery?
- What steps are involved in setting up the Cloud SQL database connection in BigQuery?
- What is the purpose of configuring public IP connectivity for your Cloud SQL instance?
- How can you enable the BigQuery connection API in the Cloud console?

