GCP Cloud Architecture (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
How do you optimize BigQuery Costs for multi-petabyte datasets?
senior LevelgcpAdvanced Internals
In Simple Words:
- Avoid
SELECT *; only query explicit columns (BigQuery charges strictly per byte of columns scanned). - Enforce
require_partition_filter = trueon partitioned tables to prevent accidental full-table scans. - Use Clustered Tables to reduce the volume of data scanned by filter predicates.
- Inspect query cost estimates with
--dry_runbefore executing expensive exploratory SQL. - Set maximum bytes billed per query limit (
maximum_bytes_billed).