Diagnosing Why SYSUTCDATETIME is Faster than SYSDATETIME

Joe Obbish is on a quest:

On my machine the code takes about 11.6 seconds to execute. Replacing SYSDATETIME() with SYSUTCDATETIME() makes the code take only 4.3 seconds to execute. Why is SYSUTCDATETIME() so much faster than SYSDATETIME()?

There’s an interesting answer to the question, so read on.

Related Posts

Relating Nonclustered Indexes to the Clustered Index

Erin Stellato takes us through a bit of indexing strategy: In the sp_SQLskills_helpindex output you’ll notice that OrderLineID is the only column in columns_in_tree, and both OrderLineID and OrderID_and_OrderLineID are in columns_in_leaf. Remember that when you identify a nonclustered index as unique, it will not add the clustering key to the tree level, it just […]

Read More

Database Page Allocations Function

Max Vernon takes us through the sys.dm_db_database_page_allocations Dynamic Management Function: sys.dm_db_database_page_allocations is an undocumented SQL Server T-SQL Dynamic Management Function. This DMF provides details about allocated pages, allocation units, and allocation extents. Read on for additional details. This is an undocumented function, so it might change between versions but it will give you an idea […]

Read More


May 2019
« Apr Jun »