Share on facebook
Share on linkedin
Share on twitter
Share on reddit

BigQuery Tip — Execute Multiple Queries in a Single Tab

In this article, you’ll see how to execute multiple queries in Google BigQuery — in parallel!

You’ll also learn about other solutions, like Query Tabs, that will help you improve your BigQuery productivity.

Let’s first jump into the core issue that is being addressed.

More Queries, More Problems

Whether you’re using BigQuery to explore a dataset or work on a company project, more often than not, you are working on more than one query at a time.

However, you lose old results after writing a new query — and re-running the previous query is time-consuming. 

The quick fix? Open multiple Chrome tabs running BigQuery, with each tab containing a different query.

For some, switching across queries in separate Chrome Tabs (holy RAM usage, Batman!) is manageable. For others, it can be annoying to find that specific query amongst a sea of indistinguishable tabs. You’d have an easier time finding Waldo. 

Which query is in which tab?

Solution #1: Query Tabs for BigQuery

In preparation for building the first iteration of superQuery’s IDE, we spoke with over 2,000 BigQuery users to learn how we could help them get the most out of BigQuery.

During those conversations, this tab issue was brought up a lot. Out of this, Multi-Tab Support for BigQuery was born. You could now separate queries into tabs . 

Each tab even had its own results grid — no more re-running queries!

Video showing how to switch query tabs in superQuery
Multi-Tab Support: Organize queries into tabs. Label them to easily find them later.

Solution #2: Multiple Queries — One BigQuery Tab

Building on this, users wanted us to go further — especially those with backgrounds in SQL Server Management Studio or Teradata.

They wanted to be able to execute multiple queries in a single BigQuery tab, and view each query’s results separately. This was actually our most popular feature request over the last five months!

For instance, if you’re exploring a dataset you might want to quickly see the progression of your results as you go along. Now that’s possible.

Simply write out your queries, separated by semicolons, and watch the results spit out faster than you can say “SELECT 1; SELECT 2; SELECT 3;“.

Here’s how it works:

Video showing how to run multiple queries in parallel with superQuery
Run multiple queries in a tab, separated by semicolons. Each query gets its own results tab.

In addition to running queries in parallel, superQuery also supports running queries in a sequence — commonly known as scripts.

This means you can set up queries to build off the results of the preceding query, as shown below.

 

How to run scripts in superQuery

 

Now it’s time for you to supercharge your BigQuery capabilities and try this out yourself.

Get the superQuery Chrome extension, or log in to superQuery if you’re already a user, and start executing multiple queries now!