BigQuery
The BigQuery reference for data engineers
Practical answers for the BigQuery questions you search every week: how a function behaves, what an error means, and what a query or a table will cost. Written by the Masthead team, who monitor BigQuery jobs, pipelines and costs for data teams every day.
Start here
- Data FinOps playbookHow BigQuery bills, how to attribute it to teams and pipelines, and the levers that cut it.
- Cost queriesReady-to-run SQL: most expensive queries, cost per user, dbt model and dashboard, unused tables.
- GA4 export queriesSessions, users, traffic, engagement and revenue from the GA4 export, runnable on Google's sample.
- Public datasetsWhat each public dataset holds, how big it is and what querying it costs.
- SQL functions143 functions with syntax, runnable examples, mistakes and cost notes.
- Statements and clausesQUALIFY, PIVOT, MERGE, partitioning, clustering, scripting and INFORMATION_SCHEMA.
- Error messagesWhat 51 common errors mean and how to fix them.
- Pricing explainedOn-demand, editions, storage and every other line on the bill, with current list prices.
- Pricing calculatorOn-demand vs editions and logical vs physical storage, with your own numbers.
- GlossarySlots, reservations, editions, lineage, data contracts and more, defined plainly.
SQL reference by category
Date functions (14)Datetime functions (8)Timestamp functions (12)String functions (28)Aggregate functions (16)Window functions (11)Array functions (11)JSON functions (14)Conversion functions (3)Conditional expressions (5)Mathematical functions (15)Hash and utility functions (6)Query syntax (11)DDL statements (8)DML statements (5)Scripting and data movement (5)INFORMATION_SCHEMA (2)
Most looked-up
Common errors
Resources exceeded during query executionUser does not have permission to query table, or perhaps it does not existDataset was not found in locationQuota exceeded: free query bytes scannedCannot query over table without a filter for partition eliminationUPDATE/MERGE must match at most one source row for each target row
BigQuery concepts
Guides from the blog
- How BigQuery fluid autoscaling eliminates the scale-down latency taxIf you run BigQuery on GCP at scale, you are likely familiar with the challenge of capacity management. To keep query performance predictabl…
- Mastering BigQuery Cost Optimization: Insights from a LinkedIn Live Deep DiveIn a recent LinkedIn Live session, Yuliia, CEO and co-founder of MastHead Data, talked about rising challenge facing data teams today: the r…
- Understanding and Managing Projects with Ad-Hoc Usage: A Better Fit for the BigQuery On-Demand Billing ModelBigQuery’s on-demand billing model offers a flexible and cost-effective solution for ad-hoc querying needs. However, understanding and manag…
- Navigating BigQuery Editions: A Guide to Choosing the Right PricingBigQuery Editions offer a flexible approach to data warehousing and analytics, catering to organizations of all sizes and with diverse workl…
- Google BigQuery Compute Cost Optimization: Mastering Editions PricingThis article is part of BigQuery Cost Optimization Series. Here is a Previous Article about GBQ Storage Cost.
- BigQuery Storage Cost Structure: A Deep Dive into OptimizationHere is our first article from the BigQuery Cost Optimisation series.
