Bigquery, Execution Plan, Query Optimization.
you see a significant difference between avg and max compute times, your data is probably skewed. Some suggestions from Google to address this type of issue is: Pre-filter rows from the table with the unbalanced key. If possible, split the query into two queries. Use the SELECT DISTINCT statement