Skip to content

Instantly share code, notes, and snippets.

@vlad-ds
Created May 11, 2022 16:10
Show Gist options
  • Save vlad-ds/f9673db5e6ec9dc2205fd266148783b8 to your computer and use it in GitHub Desktop.
Save vlad-ds/f9673db5e6ec9dc2205fd266148783b8 to your computer and use it in GitHub Desktop.
bq_sql_2
-- data for 1 day: 479 MB scanned
SELECT *
FROM `bigquery-public-data.google_trends.international_top_terms`
WHERE refresh_date = DATE_SUB(CURRENT_DATE, INTERVAL 1 DAY);
-- data for 2 days: 955 MB scanned
SELECT *
FROM `bigquery-public-data.google_trends.international_top_terms`
WHERE refresh_date > DATE_SUB(CURRENT_DATE, INTERVAL 3 DAY);
-- no partition filter: whole table scanned (15 GB)
SELECT *
FROM `bigquery-public-data.google_trends.international_top_terms`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment