Bigquery, Execution Plan, Query Optimization.
ANY_VALUE(reputation) AS reputation, COUNT(text) AS comments_count FROM users_posts GROUP BY user_id ORDER BY comments_count DESC LIMIT 20; This query takes 13 sec to finish. Bytes shuffled is 16.42 GB Image by the author Image by the author Looking at the Query Plan, we notice that the most heavy