# Reducing BigQuery Costs: How We Fixed A $1 Million Query

DevFeed: [Reducing BigQuery Costs: How We Fixed A $1 Million Query](<https://devfeed.tech/articles/reducing-bigquery-costs-how-we-fixed-a-1-million-query-1542.md>)

Original publisher: [Read original article](<https://shopify.engineering/reducing-bigquery-costs>)

Author: Calvin Zhou

Published: 2022-11-03T18:14:51Z

Content type: article

Language: en

Sources: [Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering.md>), [Shopify Engineering - Shopify Engineering](<https://devfeed.tech/sources/shopify-engineering-shopify-engineering.md>)

Topics: [BigQuery](<https://devfeed.tech/topics/bigquery.md>), [Streaming](<https://devfeed.tech/topics/streaming.md>), [apache-flink](<https://devfeed.tech/topics/apache-flink.md>), [Kafka](<https://devfeed.tech/topics/kafka.md>), [parquet](<https://devfeed.tech/topics/parquet.md>), [Google Cloud Platform (GCP)](<https://devfeed.tech/topics/google-cloud.md>), [Shopify](<https://devfeed.tech/topics/shopify.md>), [rocksdb](<https://devfeed.tech/topics/rocksdb.md>)

Tags: [apache-flink](<https://devfeed.tech/tags/apache-flink.md>), [bigquery](<https://devfeed.tech/tags/bigquery.md>), [cloud-storage](<https://devfeed.tech/tags/cloud-storage.md>), [cost](<https://devfeed.tech/tags/cost.md>), [kafka](<https://devfeed.tech/tags/kafka.md>), [parquet](<https://devfeed.tech/tags/parquet.md>), [pipelines](<https://devfeed.tech/tags/pipelines.md>), [rocksdb](<https://devfeed.tech/tags/rocksdb.md>), [shopify](<https://devfeed.tech/tags/shopify.md>), [sql](<https://devfeed.tech/tags/sql.md>)

## AI overview

The article describes how a Shopify team discovered that a BigQuery query could cost nearly $1 million USD per month while building a marketing data pipeline. The team used Apache Flink with RocksDB and Apache Kafka, then evaluated BigQuery as an external data warehouse capable of querying large datasets and exporting results to Google Cloud Storage. The supplied text ends as the team encounters the cost problem, before detailing the eventual fix.

## Source excerpt

We discovered a query that nearly cost us $1 million USD a month in BigQuery. Below, we'll share our tips for lowering costs in BigQuery.