SQL Performance of Window Functions vs Subqueries on Big Data