hits_10m_single hits_100m_single table hits_10m_single hits_100m_single SELECT avg(length(URL)) as x from {table} GROUP BY CounterID FORMAT Null settings optimize_aggregation_in_order = 1 SELECT avg(length(URL)) as x from {table} GROUP BY -CounterID FORMAT Null settings optimize_aggregation_in_order = 1 SELECT avg(length(URL)) as x from {table} GROUP BY CounterID, EventDate FORMAT Null settings optimize_aggregation_in_order = 1 SELECT avg(length(URL)) as x from hits_10m_single GROUP BY CounterID, EventDate, intHash32(UserID) FORMAT Null settings optimize_aggregation_in_order = 1