Table of Contents

Class QueryStoreSchema.QueryStoreRuntimeStat

Namespace
LinqToDB.Tools.DataProvider.SqlServer.Schemas
Assembly
linq2db.Tools.dll

sys.query_store_runtime_stats (Transact-SQL)

Applies to: √ SQL Server 2016 (13.x) and later √ Azure SQL Database √ Azure SQL Managed Instance √ Azure Synapse Analytics

Contains information about the runtime execution statistics information for the query.


See sys.query_store_runtime_stats.

[Table(Schema = "sys", Name = "query_store_runtime_stats", IsView = true)]
public class QueryStoreSchema.QueryStoreRuntimeStat
Inheritance
QueryStoreSchema.QueryStoreRuntimeStat
Extension Methods

Properties

AvgClrTime

Average CLR time for the query plan within the aggregation interval (reported in microseconds).
Note: Azure Synapse Analytics will always return zero (0).

[Column("avg_clr_time")]
[Nullable]
public double? AvgClrTime { get; set; }

Property Value

double?

AvgCpuTime

Average CPU time for the query plan within the aggregation interval (reported in microseconds).
Note: Azure Synapse Analytics will always return zero (0).

[Column("avg_cpu_time")]
[Nullable]
public double? AvgCpuTime { get; set; }

Property Value

double?

AvgDop

Average DOP (degree of parallelism) for the query plan within the aggregation interval.
Note: Azure Synapse Analytics will always return zero (0).

[Column("avg_dop")]
[Nullable]
public double? AvgDop { get; set; }

Property Value

double?

AvgDuration

Average duration for the query plan within the aggregation interval (reported in microseconds).

[Column("avg_duration")]
[Nullable]
public double? AvgDuration { get; set; }

Property Value

double?

AvgLogBytesUsed

Average number of bytes in the database log used by the query plan, within the aggregation interval.
Applies to: SQL Server (Starting with SQL Server 2017 (14.x)) and Azure SQL Database.
Note: Azure Synapse Analytics will always return zero (0).

[Column("avg_log_bytes_used")]
[Nullable]
public double? AvgLogBytesUsed { get; set; }

Property Value

double?

AvgLogicalIoReads

Average number of logical I/O reads for the query plan within the aggregation interval. (expressed as a number of 8 KB pages read).
Note: Azure Synapse Analytics will always return zero (0).

[Column("avg_logical_io_reads")]
[Nullable]
public double? AvgLogicalIoReads { get; set; }

Property Value

double?

AvgLogicalIoWrites

Average number of logical I/O writes for the query plan within the aggregation interval.
Note: Azure Synapse Analytics will always return zero (0).

[Column("avg_logical_io_writes")]
[Nullable]
public double? AvgLogicalIoWrites { get; set; }

Property Value

double?

AvgNumPhysicalIoReads

Average number of physical I/O reads for the query plan within the aggregation interval (expressed as a number of read I/O operations).
Note: Azure Synapse Analytics will always return zero (0).

[Column("avg_num_physical_io_reads")]
[Nullable]
public double? AvgNumPhysicalIoReads { get; set; }

Property Value

double?

AvgPageServerIoReads

Average number of page server I/O reads for the query plan within the aggregation interval (expressed as a number of 8 KB pages read).

Applies to: Azure SQL Database Hyperscale
Note: Azure Synapse Analytics, Azure SQL Database, Azure SQL Managed Instance (non-hyperscale) will always return zero (0).

[Column("avg_page_server_io_reads")]
[NotNull]
public double AvgPageServerIoReads { get; set; }

Property Value

double

AvgPhysicalIoReads

Average number of physical I/O reads for the query plan within the aggregation interval (expressed as a number of 8 KB pages read).
Note: Azure Synapse Analytics will always return zero (0).

[Column("avg_physical_io_reads")]
[Nullable]
public double? AvgPhysicalIoReads { get; set; }

Property Value

double?

AvgQueryMaxUsedMemory

Average memory grant (reported as the number of 8 KB pages) for the query plan within the aggregation interval. Always 0 for queries using natively compiled memory optimized procedures.
Note: Azure Synapse Analytics will always return zero (0).

[Column("avg_query_max_used_memory")]
[Nullable]
public double? AvgQueryMaxUsedMemory { get; set; }

Property Value

double?

AvgRowcount

Average number of returned rows for the query plan within the aggregation interval.
Note: Azure Synapse Analytics will always return zero (0).

[Column("avg_rowcount")]
[Nullable]
public double? AvgRowcount { get; set; }

Property Value

double?

AvgTempdbSpaceUsed

Average number of pages used in tempdb for the query plan within the aggregation interval (expressed as a number of 8 KB pages).

Applies to: SQL Server (Starting with SQL Server 2017 (14.x)) and Azure SQL Database.

[Column("avg_tempdb_space_used")]
[Nullable]
public double? AvgTempdbSpaceUsed { get; set; }

Property Value

double?

CountExecutions

Total count of executions for the query plan within the aggregation interval.

[Column("count_executions")]
[NotNull]
public long CountExecutions { get; set; }

Property Value

long

ExecutionType

Determines type of query execution:

0 - Regular execution (successfully finished)

3 - Client initiated aborted execution

4 - Exception aborted execution

[Column("execution_type")]
[NotNull]
public byte ExecutionType { get; set; }

Property Value

byte

ExecutionTypeDesc

Textual description of the execution type field:

0 - Regular

3 - Aborted

4 - Exception

[Column("execution_type_desc")]
[Nullable]
public string? ExecutionTypeDesc { get; set; }

Property Value

string

FirstExecutionTime

First execution time for the query plan within the aggregation interval. This is the end time of the query execution.

[Column("first_execution_time")]
[NotNull]
public DateTimeOffset FirstExecutionTime { get; set; }

Property Value

DateTimeOffset

LastClrTime

Last CLR time for the query plan within the aggregation interval (reported in microseconds).
Note: Azure Synapse Analytics will always return zero (0).

[Column("last_clr_time")]
[NotNull]
public long LastClrTime { get; set; }

Property Value

long

LastCpuTime

Last CPU time for the query plan within the aggregation interval (reported in microseconds).
Note: Azure Synapse Analytics will always return zero (0).

[Column("last_cpu_time")]
[NotNull]
public long LastCpuTime { get; set; }

Property Value

long

LastDop

Last DOP (degree of parallelism) for the query plan within the aggregation interval.
Note: Azure Synapse Analytics will always return zero (0).

[Column("last_dop")]
[NotNull]
public long LastDop { get; set; }

Property Value

long

LastDuration

Last duration for the query plan within the aggregation interval (reported in microseconds).

[Column("last_duration")]
[NotNull]
public long LastDuration { get; set; }

Property Value

long

LastExecutionTime

Last execution time for the query plan within the aggregation interval. This is the end time of the query execution.

[Column("last_execution_time")]
[NotNull]
public DateTimeOffset LastExecutionTime { get; set; }

Property Value

DateTimeOffset

LastLogBytesUsed

Number of bytes in the database log used by the last execution of the query plan, within the aggregation interval.
Applies to: SQL Server (Starting with SQL Server 2017 (14.x)) and Azure SQL Database.
Note: Azure Synapse Analytics will always return zero (0).

[Column("last_log_bytes_used")]
[Nullable]
public long? LastLogBytesUsed { get; set; }

Property Value

long?

LastLogicalIoReads

Last number of logical I/O reads for the query plan within the aggregation interval. (expressed as a number of 8 KB pages read).
Note: Azure Synapse Analytics will always return zero (0).

[Column("last_logical_io_reads")]
[NotNull]
public long LastLogicalIoReads { get; set; }

Property Value

long

LastLogicalIoWrites

Last number of logical I/O writes for the query plan within the aggregation interval.
Note: Azure Synapse Analytics will always return zero (0).

[Column("last_logical_io_writes")]
[NotNull]
public long LastLogicalIoWrites { get; set; }

Property Value

long

LastNumPhysicalIoReads

Last number of physical I/O reads for the query plan within the aggregation interval (expressed as a number of read I/O operations).
Note: Azure Synapse Analytics will always return zero (0).

[Column("last_num_physical_io_reads")]
[Nullable]
public long? LastNumPhysicalIoReads { get; set; }

Property Value

long?

LastPageServerIoReads

Last number of page server I/O reads for the query plan within the aggregation interval (expressed as a number of 8 KB pages read).

Applies to: Azure SQL Database Hyperscale
Note: Azure Synapse Analytics, Azure SQL Database, Azure SQL Managed Instance (non-hyperscale) will always return zero (0).

[Column("last_page_server_io_reads")]
[NotNull]
public long LastPageServerIoReads { get; set; }

Property Value

long

LastPhysicalIoReads

Last number of physical I/O reads for the query plan within the aggregation interval (expressed as a number of 8 KB pages read).
Note: Azure Synapse Analytics will always return zero (0).

[Column("last_physical_io_reads")]
[NotNull]
public long LastPhysicalIoReads { get; set; }

Property Value

long

LastQueryMaxUsedMemory

Last memory grant (reported as the number of 8 KB pages) for the query plan within the aggregation interval. Always 0 for queries using natively compiled memory optimized procedures.
Note: Azure Synapse Analytics will always return zero (0).

[Column("last_query_max_used_memory")]
[NotNull]
public long LastQueryMaxUsedMemory { get; set; }

Property Value

long

LastRowcount

Number of returned rows by the last execution of the query plan within the aggregation interval.
Note: Azure Synapse Analytics will always return zero (0).

[Column("last_rowcount")]
[NotNull]
public long LastRowcount { get; set; }

Property Value

long

LastTempdbSpaceUsed

Last number of pages used in tempdb for the query plan within the aggregation interval (expressed as a number of 8 KB pages).

Applies to: SQL Server (Starting with SQL Server 2017 (14.x)) and Azure SQL Database.

[Column("last_tempdb_space_used")]
[Nullable]
public long? LastTempdbSpaceUsed { get; set; }

Property Value

long?

MaxClrTime

Maximum CLR time for the query plan within the aggregation interval (reported in microseconds).
Note: Azure Synapse Analytics will always return zero (0).

[Column("max_clr_time")]
[NotNull]
public long MaxClrTime { get; set; }

Property Value

long

MaxCpuTime

Maximum CPU time for the query plan within the aggregation interval (reported in microseconds).
Note: Azure Synapse Analytics will always return zero (0).

[Column("max_cpu_time")]
[NotNull]
public long MaxCpuTime { get; set; }

Property Value

long

MaxDop

Maximum DOP (degree of parallelism) for the query plan within the aggregation interval.
Note: Azure Synapse Analytics will always return zero (0).

[Column("max_dop")]
[NotNull]
public long MaxDop { get; set; }

Property Value

long

MaxDuration

Maximum duration for the query plan within the aggregation interval (reported in microseconds).

[Column("max_duration")]
[NotNull]
public long MaxDuration { get; set; }

Property Value

long

MaxLogBytesUsed

Maximum number of bytes in the database log used by the query plan, within the aggregation interval.
Applies to: SQL Server (Starting with SQL Server 2017 (14.x)) and Azure SQL Database.
Note: Azure Synapse Analytics will always return zero (0).

[Column("max_log_bytes_used")]
[Nullable]
public long? MaxLogBytesUsed { get; set; }

Property Value

long?

MaxLogicalIoReads

Maximum number of logical I/O reads for the query plan within the aggregation interval.(expressed as a number of 8 KB pages read).
Note: Azure Synapse Analytics will always return zero (0).

[Column("max_logical_io_reads")]
[NotNull]
public long MaxLogicalIoReads { get; set; }

Property Value

long

MaxLogicalIoWrites

Maximum number of logical I/O writes for the query plan within the aggregation interval.
Note: Azure Synapse Analytics will always return zero (0).

[Column("max_logical_io_writes")]
[NotNull]
public long MaxLogicalIoWrites { get; set; }

Property Value

long

MaxNumPhysicalIoReads

Maximum number of physical I/O reads for the query plan within the aggregation interval (expressed as a number of read I/O operations).
Note: Azure Synapse Analytics will always return zero (0).

[Column("max_num_physical_io_reads")]
[Nullable]
public long? MaxNumPhysicalIoReads { get; set; }

Property Value

long?

MaxPageServerIoReads

Maximum number of page server I/O reads for the query plan within the aggregation interval (expressed as a number of 8 KB pages read).

Applies to: Azure SQL Database Hyperscale
Note: Azure Synapse Analytics, Azure SQL Database, Azure SQL Managed Instance (non-hyperscale) will always return zero (0).

[Column("max_page_server_io_reads")]
[NotNull]
public long MaxPageServerIoReads { get; set; }

Property Value

long

MaxPhysicalIoReads

Maximum number of physical I/O reads for the query plan within the aggregation interval (expressed as a number of 8 KB pages read).
Note: Azure Synapse Analytics will always return zero (0).

[Column("max_physical_io_reads")]
[NotNull]
public long MaxPhysicalIoReads { get; set; }

Property Value

long

MaxQueryMaxUsedMemory

Maximum memory grant (reported as the number of 8 KB pages) for the query plan within the aggregation interval. Always 0 for queries using natively compiled memory optimized procedures.
Note: Azure Synapse Analytics will always return zero (0).

[Column("max_query_max_used_memory")]
[NotNull]
public long MaxQueryMaxUsedMemory { get; set; }

Property Value

long

MaxRowcount

Maximum number of returned rows for the query plan within the aggregation interval.

[Column("max_rowcount")]
[NotNull]
public long MaxRowcount { get; set; }

Property Value

long

MaxTempdbSpaceUsed

Maximum number of pages used in tempdb for the query plan within the aggregation interval (expressed as a number of 8 KB pages).

Applies to: SQL Server (Starting with SQL Server 2017 (14.x)) and Azure SQL Database.

[Column("max_tempdb_space_used")]
[Nullable]
public long? MaxTempdbSpaceUsed { get; set; }

Property Value

long?

MinClrTime

Minimum CLR time for the query plan within the aggregation interval (reported in microseconds).
Note: Azure Synapse Analytics will always return zero (0).

[Column("min_clr_time")]
[NotNull]
public long MinClrTime { get; set; }

Property Value

long

MinCpuTime

Minimum CPU time for the query plan within the aggregation interval (reported in microseconds).
Note: Azure Synapse Analytics will always return zero (0).

[Column("min_cpu_time")]
[NotNull]
public long MinCpuTime { get; set; }

Property Value

long

MinDop

Minimum DOP (degree of parallelism) for the query plan within the aggregation interval.
Note: Azure Synapse Analytics will always return zero (0).

[Column("min_dop")]
[NotNull]
public long MinDop { get; set; }

Property Value

long

MinDuration

Minimum duration for the query plan within the aggregation interval (reported in microseconds).

[Column("min_duration")]
[NotNull]
public long MinDuration { get; set; }

Property Value

long

MinLogBytesUsed

Minimum number of bytes in the database log used by the query plan, within the aggregation interval.
Applies to: SQL Server (Starting with SQL Server 2017 (14.x)) and Azure SQL Database.
Note: Azure Synapse Analytics will always return zero (0).

[Column("min_log_bytes_used")]
[Nullable]
public long? MinLogBytesUsed { get; set; }

Property Value

long?

MinLogicalIoReads

Minimum number of logical I/O reads for the query plan within the aggregation interval. (expressed as a number of 8 KB pages read).
Note: Azure Synapse Analytics will always return zero (0).

[Column("min_logical_io_reads")]
[NotNull]
public long MinLogicalIoReads { get; set; }

Property Value

long

MinLogicalIoWrites

Minimum number of logical I/O writes for the query plan within the aggregation interval.
Note: Azure Synapse Analytics will always return zero (0).

[Column("min_logical_io_writes")]
[NotNull]
public long MinLogicalIoWrites { get; set; }

Property Value

long

MinNumPhysicalIoReads

Minimum number of physical I/O reads for the query plan within the aggregation interval (expressed as a number of read I/O operations).
Note: Azure Synapse Analytics will always return zero (0).

[Column("min_num_physical_io_reads")]
[Nullable]
public long? MinNumPhysicalIoReads { get; set; }

Property Value

long?

MinPageServerIoReads

Minimum number of page server I/O reads for the query plan within the aggregation interval (expressed as a number of 8 KB pages read).

Applies to: Azure SQL Database Hyperscale
Note: Azure Synapse Analytics, Azure SQL Database, Azure SQL Managed Instance (non-hyperscale) will always return zero (0).

[Column("min_page_server_io_reads")]
[NotNull]
public long MinPageServerIoReads { get; set; }

Property Value

long

MinPhysicalIoReads

Minimum number of physical I/O reads for the query plan within the aggregation interval (expressed as a number of 8 KB pages read).
Note: Azure Synapse Analytics will always return zero (0).

[Column("min_physical_io_reads")]
[NotNull]
public long MinPhysicalIoReads { get; set; }

Property Value

long

MinQueryMaxUsedMemory

Minimum memory grant (reported as the number of 8 KB pages) for the query plan within the aggregation interval. Always 0 for queries using natively compiled memory optimized procedures.
Note: Azure Synapse Analytics will always return zero (0).

[Column("min_query_max_used_memory")]
[NotNull]
public long MinQueryMaxUsedMemory { get; set; }

Property Value

long

MinRowcount

Minimum number of returned rows for the query plan within the aggregation interval.
Note: Azure Synapse Analytics will always return zero (0).

[Column("min_rowcount")]
[NotNull]
public long MinRowcount { get; set; }

Property Value

long

MinTempdbSpaceUsed

Minimum number of pages used in tempdb for the query plan within the aggregation interval (expressed as a number of 8 KB pages).

Applies to: SQL Server (Starting with SQL Server 2017 (14.x)) and Azure SQL Database.

[Column("min_tempdb_space_used")]
[Nullable]
public long? MinTempdbSpaceUsed { get; set; }

Property Value

long?

PlanID

Foreign key. Joins to sys.query_store_plan (Transact-SQL).

[Column("plan_id")]
[NotNull]
public long PlanID { get; set; }

Property Value

long

RuntimeStatsID

Identifier of the row that represents runtime execution statistics for the plan_id, execution_type and runtime_stats_interval_id. It is unique only for the past runtime statistics intervals. For currently active interval, there may be multiple rows representing runtime statistics for the plan referenced by plan_id, with the execution type represented by execution_type. Typically, one row represents runtime statistics that are flushed to disk, while other(s) represent in-memory state. Hence, to get actual state for every interval you need to aggregate metrics, grouping by plan_id, execution_type and runtime_stats_interval_id.
Note: Azure Synapse Analytics will always return zero (0).

[Column("runtime_stats_id")]
[NotNull]
public long RuntimeStatsID { get; set; }

Property Value

long

RuntimeStatsIntervalID

[Column("runtime_stats_interval_id")]
[NotNull]
public long RuntimeStatsIntervalID { get; set; }

Property Value

long

StdevClrTime

CLR time standard deviation for the query plan within the aggregation interval (reported in microseconds).
Note: Azure Synapse Analytics will always return zero (0).

[Column("stdev_clr_time")]
[Nullable]
public double? StdevClrTime { get; set; }

Property Value

double?

StdevCpuTime

CPU time standard deviation for the query plan within the aggregation interval (reported in microseconds).
Note: Azure Synapse Analytics will always return zero (0).

[Column("stdev_cpu_time")]
[Nullable]
public double? StdevCpuTime { get; set; }

Property Value

double?

StdevDop

DOP (degree of parallelism) standard deviation for the query plan within the aggregation interval.
Note: Azure Synapse Analytics will always return zero (0).

[Column("stdev_dop")]
[Nullable]
public double? StdevDop { get; set; }

Property Value

double?

StdevDuration

Duration standard deviation for the query plan within the aggregation interval (reported in microseconds).

[Column("stdev_duration")]
[Nullable]
public double? StdevDuration { get; set; }

Property Value

double?

StdevLogBytesUsed

Standard deviation of the number of bytes in the database log used by a query plan, within the aggregation interval.
Applies to: SQL Server (Starting with SQL Server 2017 (14.x)) and Azure SQL Database.
Note: Azure Synapse Analytics will always return zero (0).

[Column("stdev_log_bytes_used")]
[Nullable]
public double? StdevLogBytesUsed { get; set; }

Property Value

double?

StdevLogicalIoReads

Number of logical I/O reads standard deviation for the query plan within the aggregation interval. (expressed as a number of 8 KB pages read).
Note: Azure Synapse Analytics will always return zero (0).

[Column("stdev_logical_io_reads")]
[Nullable]
public double? StdevLogicalIoReads { get; set; }

Property Value

double?

StdevLogicalIoWrites

Number of logical I/O writes standard deviation for the query plan within the aggregation interval.
Note: Azure Synapse Analytics will always return zero (0).

[Column("stdev_logical_io_writes")]
[Nullable]
public double? StdevLogicalIoWrites { get; set; }

Property Value

double?

StdevPageServerIoReads

Standard deviation of the number of page server I/O reads for the query plan within the aggregation interval (expressed as a number of 8 KB pages read).

Applies to: Azure SQL Database Hyperscale
Note: Azure Synapse Analytics, Azure SQL Database, Azure SQL Managed Instance (non-hyperscale) will always return zero (0).

[Column("stdev_page_server_io_reads")]
[NotNull]
public double StdevPageServerIoReads { get; set; }

Property Value

double

StdevPhysicalIoReads

Number of physical I/O reads standard deviation for the query plan within the aggregation interval (expressed as a number of 8 KB pages read).
Note: Azure Synapse Analytics will always return zero (0).

[Column("stdev_physical_io_reads")]
[Nullable]
public double? StdevPhysicalIoReads { get; set; }

Property Value

double?

StdevQueryMaxUsedMemory

Memory grant standard deviation (reported as the number of 8 KB pages) for the query plan within the aggregation interval. Always 0 for queries using natively compiled memory optimized procedures.
Note: Azure Synapse Analytics will always return zero (0).

[Column("stdev_query_max_used_memory")]
[Nullable]
public double? StdevQueryMaxUsedMemory { get; set; }

Property Value

double?

StdevRowcount

Standard deviation of the number of returned rows for the query plan within the aggregation interval.

[Column("stdev_rowcount")]
[Nullable]
public double? StdevRowcount { get; set; }

Property Value

double?

StdevTempdbSpaceUsed

Number of pages used in tempdb standard deviation for the query plan within the aggregation interval (expressed as a number of 8 KB pages).

Applies to: SQL Server (Starting with SQL Server 2017 (14.x)) and Azure SQL Database.

[Column("stdev_tempdb_space_used")]
[Nullable]
public double? StdevTempdbSpaceUsed { get; set; }

Property Value

double?