DB1という名前のデータベースがあり、700ギガバイト(GB)を超えるデータを格納し、1時間あたり数百万の要求を処理します。 DB1に対するクエリは、完了までに通常より長くかかります。 次のTransact-SQLステートメントを実行します。 SELECT * FROM sys.database_query_store_optionsから クエリストアが読み取り専用モードになっていると判断した。 クエリストアが読み書きモードになっている時間を最大にする必要があります。 どのTransact-SQLステートメントを実行しますか?
正解:C
Explanation Stale Query Threshold (Days): Time-based cleanup policy that controls the retention period of persisted runtime statistics and inactive queries. By default, Query Store is configured to keep the data for 30 days which may be unnecessarily long for your scenario. Avoid keeping historical data that you do not plan to use. This will reduce changes to read-only status. The size of Query Store data as well as the time to detect and mitigate the issue will be more predictable. Use Management Studio or the following script to configure time-based cleanup policy: ALTER DATABASE [QueryStoreDB] SET QUERY_STORE (CLEANUP_POLICY = (STALE_QUERY_THRESHOLD_DAYS = 14)); References: https://docs.microsoft.com/en-us/sql/relational-databases/performance/best-practice-with-the-query-store