Remove how-to-use-sargable-expressions-in-t-sql-queries-performance-advantages-and-examples
article thumbnail

DATE_BUCKET and DATETRUNC Improve Optimization of Time-Based Grouping

SQL Performance

Time-based grouping and aggregation are common in analyzing data using T-SQL—for example, grouping sales orders by year or by week and computing order counts per group. SQL Server 2022 introduces new ways to apply time-based grouping using the DATE_BUCKET and DATETRUNC functions. Figure 1: Plan for Query 1.

Servers 144