sp_query_store_flush_db (Transact-SQL)
Applies to:
SQL Server 2016 (13.x) and later
Azure SQL Database
Azure SQL Managed Instance
Flushes the in-memory portion of the Query Store data to disk.
Transact-SQL syntax conventions
Syntax
sp_query_store_flush_db
[ ; ]
Return code values
0
(success) or 1
(failure).
Remarks
If Query Store for secondary replicas is enabled, when sys.sp_query_store_flush_db
is executed on a secondary replica, that secondary replica's cache is forced to flush to the cache on the primary replica. This can accelerate the Query Store cache data being synced to the primary replica, if the secondary replica cache flush is otherwise delayed under heavy workload.
Permissions
Requires the ALTER permission on the database.
Examples
The following example flushes the in-memory portion of the Query Store data to disk.
EXEC sp_query_store_flush_db;
Related content
- Monitoring Performance By Using the Query Store
- Query Store for secondary replicas
- sp_query_store_force_plan (Transact-SQL)
- sp_query_store_remove_query (Transact-SQL)
- sp_query_store_unforce_plan (Transact-SQL)
- sp_query_store_reset_exec_stats (Transact-SQL)
- sp_query_store_remove_plan (Transact-SQL)
- Query Store Catalog Views (Transact-SQL)
Povratne informacije
https://aka.ms/ContentUserFeedback.
Stiže uskoro: Tijekom 2024. postupno ćemo ukinuti servis Problemi sa servisom GitHub kao mehanizam za povratne informacije za sadržaj i zamijeniti ga novim sustavom za povratne informacije. Dodatne informacije potražite u članku:Pošaljite i pogledajte povratne informacije za