Doing Query and Cost Analysis for BQ in Metabase
An idea suggested by the datafold team to better understand costly queries was just plugin information schema into metabase. This is possible but a bit tricky. You need to add a true dataset and not information schema directly otherwise you'll get errors (I'm not sure why):
When adding, just add a true dataset here:
Then you can query via SQL as:
Save this as a subview and then you can slice and dice with metabases visual query engine.
Alternatively save this as a snippet:
WITH base_queries as (
SELECT creation_time, user_email, job_type, statement_type,
total_bytes_processed, total_bytes_billed, query
FROM `region-us`.INFORMATION_SCHEMA.JOBS_BY_PROJECT
ORDER BY creation_time DESC
)