Generally, queries that do less perform better. When evaluating query performance, the amount of work required depends on the following factors:
- Input data and data sources (I/O): How many bytes does your query read?
- Communication between nodes (shuffling): How many bytes does your query pass to the next stage?
- Computation: How much CPU work does your query require?
- Outputs (materialization): How many bytes does your query write?
- Query anti-patterns: Are your queries following SQL best practices?
If query execution isn’t meeting your service level agreements, or you’re encountering errors due to resource exhaustion or timeout, consider BigQuery optimization.