Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

Window Functions - Performance when only care about last value in window

$
0
0
I am writing some scripts to calculate mean (avg) stdevs count and percentile_cont for some dataI am partitioning over multiple columns e.g. partition by year,month, day order by valueMy question is am I performing unnecessary overhead as I throw away all but the last (or max) value in each window. (I use cte then select max from cte)That is I only care about the avg of the window in its entirety not specific subwindows.I traditionally used group by.What do you suggestHopefully question is clear.

Viewing all articles
Browse latest Browse all 3145

Trending Articles