Skip to content

Latest commit

 

History

History
53 lines (42 loc) · 2.7 KB

File metadata and controls

53 lines (42 loc) · 2.7 KB
title sys.database_query_store_internal_state (Transact-SQL)
description sys.database_query_store_internal_state contains information about queue length and memory usage for the Query Store when Query Store for secondary replicas is enabled.
author rwestMSFT
ms.author randolphwest
ms.date 11/17/2025
ms.service sql
ms.subservice system-objects
ms.topic reference
f1_keywords
QUERY_STORE_INTERNAL_STATE
SYS.QUERY_STORE_INTERNAL_STATE_TSQL
SYS.QUERY_STORE_INTERNAL_STATE
QUERY_STORE_INTERNAL_STATE_TSQL
helpviewer_keywords
database_query_store_internal_state catalog view
sys.database_query_store_internal_state catalog view
dev_langs
TSQL
monikerRange >=sql-server-ver16||>=sql-server-linux-ver16||=azuresqldb-current

sys.database_query_store_internal_state (Transact-SQL)

[!INCLUDE sqlserver2025-asdb]

Contains information about queue length and memory usage for the Query Store when the Query Store for secondary replicas is enabled.

Query Store for secondary replicas is supported starting in [!INCLUDE sssql25-md] and later versions, and in Azure SQL Database. For complete platform support, see Query Store for secondary replicas.

Column name Data type Description
pending_message_count bigint The number of messages waiting in the queue on the primary for the replica where the system view is being viewed from. Not nullable.
messaging_memory_used_mb bigint The amount of memory in total taken up by the messages in the queue. Not nullable.

Permissions

Requires the VIEW DATABASE STATE permission.

Remarks

For information on configured replicas for Query Store, see sys.query_store_replicas (Transact-SQL).

Next steps

Learn more about Query Store and related concepts in the following articles: