DEV Community

Cover image for How to reuse BigQuery cached results
Marcelo Costa
Marcelo Costa

Posted on

How to reuse BigQuery cached results

When it comes to using Google BigQuery for data analysis, cost-effectiveness is a key concern. While BigQuery itself offers an affordable solution, the real challenge lies in optimising your queries to avoid skyrocketing expenses.

By leveraging the nature of temporarily created tables in BigQuery, you can seamlessly integrate them into subsequent queries, saving costs!

When you run a query, a temporary, cached results table is created in a special dataset referred to as an "anonymous dataset". docs

In Short, BigQuery will create a temporary table for each query you run:
Temp Table

It can be accessed on subsequent queries and will exist for 24 hours:

Cached Results

So whenever you are a processing a big chunk of data, keep in mind that this strategy can help you run tests, analysis and even connect it to Looker, happy costs saving!

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay