06 Oct 21 ·  mCollins in Bigquery ·        Bookmark ·  Report ·  More actions.. Lock comments ·  Pin thread

BigQuery Best Practices: Avoid SELECT *

BigQuery is a columnar database.  Using SELECT * is the most expensive way to query data. When you use SELECT *, BigQuery does a full scan of every column in the table.

Instead, Query only the columns that are required. BigQuery will only fetch the specified columns and it will comparatively faster and cheaper

For example:

select * from employee

can be rewritten as

select id, name from employee

Tip: Columnar databases can pick the required columns alone are very efficient at processing column level aggregations. So, avoid SELECT * when possible

mCollins

posted on 06 Oct 21

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds