How Query Store Stores Date Data

Erin Stellato shows us a few nuances to the way that Query Store handles dates internally:

Query Store retains query performance data at the plan level.  This data is then broken out into intervals of time, determined by the INTERVAL_LENGTH_MINUTES setting.  The time intervals are found in the sys.query_store_runtime_stats_interval system view, and the start_time and end_time columns are of the DATETIMEOFFSET data type.  This means that the date is time-zone aware, and in Query Store the data is stored as UTC.  Now why does all of this matter?  Because handling dates in Query Store is important if you’re going to query the data directly.

Click through to see a query of what this looks like, as well as a few tips on parsing the data.

Related Posts

Finding Memory-Rich Queries

Matthew McGiffen wants to find the queries which demand the largest memory grants: I had a server that looked like it had been suffering from memory contention. I wanted to see what queries were being run that had high memory requirements. The problem was that it wasn’t happening right now – I needed to be […]

Read More

Query Store Required Permissions

Andreas Wolter takes us through exactly which permissions are required for Query Store to work: Typically, there are 3 aspects to the work with the Query Store, which can be reflected in roles: 1) Configuration – turning Query Store on and off, clearing the contents, flushing its contents to disk and changing its settings.2) Viewing the […]

Read More

Categories

January 2019
MTWTFSS
« Dec Feb »
 123456
78910111213
14151617181920
21222324252627
28293031