Bigquery, Execution Plan, Query Optimization.
stage is S04: Join+ and S05:Sort Lets say a join & order by are unavoidable as per user’s request. However, we can pre-aggregate the comment_counts by user_id before the JOIN to reduce the amount of data read & write at stage 4&5 Lets run the optimized query again: WITH comments AS ( SELECT