T-SQL performance tuning tips based on SQL Server 2012 window functions