{"id":5403,"date":"2015-06-08T00:00:00","date_gmt":"2015-06-08T00:00:00","guid":{"rendered":""},"modified":"2025-09-17T08:57:12","modified_gmt":"2025-09-17T15:57:12","slug":"query-store-a-flight-data-recorder-for-your-database","status":"publish","type":"post","link":"https:\/\/azure.microsoft.com\/en-us\/blog\/query-store-a-flight-data-recorder-for-your-database\/","title":{"rendered":"Query Store: A flight data recorder for your database"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Query Store is a new feature in SQL Server 2016, and now available in preview on the latest version of Azure SQL Database V12. It\u2019s designed to help you with query performance troubleshooting.<br>As your database grows in size it is not unusual to experience performance regressions. Without the ability to see all the changes in the query plans it\u2019s difficult to figure out why regressions happen and what you can do to prevent them in the future. Troubleshooting can take hours or even days away from your precious productivity time.<br>Similar to an airplane\u2019s flight data recorder, Query Store collects and presents detailed historic information about all queries, greatly simplifying performance forensics by reducing the time to diagnose and resolve issues.<br>Collected data is separated by time windows, allowing you to observe changes in query performance over time. If a query generates different plans, you can use Query Store to analyze the plan changes, identify possible performance degradation, and even force the query processor to use a particular plan for your query.<br>Query Store is accessible through Transact-SQL. To analyze collected data and manage the feature you must install SQL Server Management Studio or SQL Server Data Tools.<br>We <strong>strongly recommend<\/strong> that you to use <strong><a href=\"https:\/\/www.microsoft.com\/en-us\/evalcenter\/evaluate-sql-server-2016?i=1\" target=\"_blank\" rel=\"noreferrer noopener\">SQL Server 2016 Management Studio Community Technology Preview 2<\/a> , <\/strong>because it comes with a new user interface especially designed for Query Store<strong>.<\/strong><br>Let&#8217;s take a look on how to get started using Query Store for query performance analysis!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-1-enable-query-store-for-your-database\">Step 1: Enable Query Store for your database<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Query Store is a database scoped feature so you must first enable it for the databases that you want to monitor. Once enabled, Query Store will store collected data inside the database storage space. To enable the feature for SQL Database, connect to your Azure SQL Server instance and run the following script while you are connected to the <strong>master<\/strong> database:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nALTER DATABASE SET QUERY_STORE = ON;\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Alternatively, if you run SSMS 2016 CTP2, you can enable the feature from the user interface. Just right click the target database and click the Properties\/Query Store tab:<\/p>\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/06\/Query-Store-Properties_thumb.webp\" alt=\"graphical user interface, chart, bubble chart\" class=\"wp-image-9328 webp-format\" data-orig-src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/06\/Query-Store-Properties_thumb.webp\"><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You may want to change defaults for the following options in order to adjust them to your requirements:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\"><strong>Max Size MB<\/strong> \u2013 limit for the data space that Query Store will take inside your database. The default (<strong>100 MB<\/strong>) may not be sufficient if your workload generates large number of different queries or plans or if you want to keep query history for a longer period of time. Keep track of current space usage and increase configuration value to prevent Query Store from switching to \u201cRead Only\u201d mode when disk size exceeds the limit.<\/li>\n\n\n\n<li class=\"wp-block-list-item\"><strong>Statistics Collection Interval<\/strong>: defines level of granularity for the runtime data (the default is <strong>1 hour<\/strong>). Consider using lower value if you need finer granularity but keep in mind that it will directly affect the size of Query Store data.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For more details on other options please refer to the <a href=\"https:\/\/aka.ms\/querystore\">MSDN documentation<\/a> for Query Store.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-2-run-the-workload-and-perform-data-analysis\">Step 2: Run the workload and perform data analysis<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In this step, we will show you how to use Query Store to easily identify the most resource consuming queries in your workload.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you run SSMS 2016 CTP2, double click on <strong>Top Resource Consuming Queries<\/strong>, located in the <strong>Query Store<\/strong> sub-folder under the database node in Object Explorer. That will open a new window with detailed information on the most expensive queries in your system:<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/06\/QDS-Top-Resource-Consuming-Qrys-Compact_thumb.webp\" alt=\"graphical user interface\" class=\"wp-image-9330 webp-format\" style=\"width:883px;height:auto\" data-orig-src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/06\/QDS-Top-Resource-Consuming-Qrys-Compact_thumb.webp\"><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">User interface is separated into three panes: A histogram representing top resource consuming queries (left), a plan summary for selected query (right) and visual query plan for selected plan (bottom). Click the <strong>Configure<\/strong> button to control how many queries you want to analyze and the time interval of interest. Additionally, you can choose between different resource consumption dimensions (duration, CPU, memory, IO, number of execution) and the baseline (Average, Min, Max, Total, Standard Deviation).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A tooltip over the query provides details on query text, query id (internal identification), average duration, execution count and the number of different plans. Look at the plan summary on the right to analyze the execution history and learn about the different plans and their runtime statistics. Use the bottom pane to examine the different plan shapes or to compare them visually, rendered side by side (use the <strong>Compare<\/strong> button).<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>View<\/strong><\/td><td><strong>Description<\/strong><\/td><\/tr><tr><td><strong>sys.query_store_query_text<\/strong><\/td><td>Information about captured query texts.<\/td><\/tr><tr><td><strong>sys.query_context_settings<\/strong><\/td><td>Different runtime combinations of semantics-affecting context settings (SET options that influence plan shape, language ID, \u2026)<\/td><\/tr><tr><td><strong>sys.query_store_query<\/strong><\/td><td>Unique combination of query text and context settings<\/td><\/tr><tr><td><strong>sys.query_store_plan<\/strong><\/td><td>Information about plans SQL Server uses to execute queries in the system.<\/td><\/tr><tr><td><strong>sys.query_store_runtime_stats_interval<\/strong><\/td><td>Aggregation intervals (time windows) created in Query Store.<\/td><\/tr><tr><td><strong>sys.query_store_runtime_stats<\/strong><\/td><td>Runtime statistics for executed query plans, aggregated on per-interval basis<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following script to get&nbsp;<em>25 queries based on total duration within last hour of execution<\/em>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nWITH AggregatedDurationLastHour\nAS\n(\n   SELECT q.query_id, SUM(count_executions * avg_duration) AS total_duration,\n   COUNT (distinct p.plan_id) AS number_of_plans\n   FROM sys.query_store_query_text AS qt JOIN sys.query_store_query AS q \n   ON qt.query_text_id = q.query_text_id\n   JOIN sys.query_store_plan AS p ON q.query_id = p.query_id\n   JOIN sys.query_store_runtime_stats AS rs ON rs.plan_id = p.plan_id\n   JOIN sys.query_store_runtime_stats_interval AS rsi \n   ON rsi.runtime_stats_interval_id = rs.runtime_stats_interval_id\n   WHERE rsi.start_time >= DATEADD(hour, -1, GETUTCDATE()) \n   AND rs.execution_type_desc = 'Regular'\n   GROUP BY q.query_id\n)\n,OrderedDuration\nAS\n(\n   SELECT query_id, total_duration, number_of_plans, \n   ROW_NUMBER () OVER (ORDER BY total_duration DESC, query_id) AS RN\n   FROM AggregatedDurationLastHour\n)\nSELECT qt.query_sql_text, object_name(q.object_id) AS containing_object,\ntotal_duration AS total_duration_microseconds, number_of_plans,\nCONVERT(xml, p.query_plan) AS query_plan_xml, p.is_forced_plan, p.last_compile_start_time,q.last_execution_time\nFROM OrderedDuration od JOIN sys.query_store_query AS q ON q.query_id  = od.query_id\nJOIN sys.query_store_query_text qt ON q.query_text_id = qt.query_text_id\nJOIN sys.query_store_plan p ON q.query_id = p.query_id\nWHERE OD.RN <=25 ORDER BY total_duration DESC\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">The query returns data set as shown on the picture below. Use this result directly or as an input for further analysis based on Transact-SQL scripts.&nbsp;<a href=\"https:\/\/aka.ms\/querystore\">Query Store<\/a>&nbsp;on MSDN provides more examples.<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/06\/top-25-Query-Results_thumb.webp\" alt=\"table\" class=\"wp-image-9332 webp-format\" style=\"width:1026px;height:auto\" title=\"Top 25 Resource Consuming Queries\" data-orig-src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/06\/top-25-Query-Results_thumb.webp\"><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"step-3-fix-performance-for-regressed-queries\">Step 3: Fix performance for regressed queries<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If your workload contains a query that is being executed with different plans and variable performance, you can use Query Store to force SQL Server to always use the optimal plan in future executions. The picture below shows how execution history might look like for one of those queries (<strong>query_id<\/strong> and <strong>plan_id<\/strong> are permanent internal identifiers assigned by the Query Store to all collected queries and plans) :<\/p>\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/06\/Plan-History-Compact.-png_thumb.webp\" alt=\"graphical user interface\" class=\"wp-image-9334 webp-format\" style=\"width:921px;height:auto\" title=\"Execution history for selected query\" data-orig-src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/06\/Plan-History-Compact.-png_thumb.webp\"><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The plan Summary pane for Query 1 clearly shows that the query had two plans and the execution with plan id = 1 was much better in terms of duration. Click the <strong>Force Plan<\/strong> button when plan id = 1 is selected to make sure that SQL Server always uses that plan. Forced plan now appears with a check mark and Plan Summary shows that it\u2019s being used in subsequent executions:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img decoding=\"async\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/06\/Plan-forcing-compact_thumb.webp\" alt=\"Query Store: A flight data recorder for your database\" style=\"width:914px;height:auto\" title=\"Execution history after plan forcing\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Plan forcing from Transact-SQL<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you run SQL Server Management Studio prior to 2016 CTP2 you can identify queries with plan regressions by directly querying Query Store views. The script from above is slightly modified to return queries with multiple plans and to include average duration per plan for every measurement interval for the purpose of comparison:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nWITH AggregatedDurationLastHour\nAS\n(\n   SELECT q.query_id, SUM(count_executions * avg_duration) AS total_duration,\n   COUNT (distinct p.plan_id) AS number_of_plans\n   FROM sys.query_store_query_text AS qt JOIN sys.query_store_query AS q \n   ON qt.query_text_id = q.query_text_id\n   JOIN sys.query_store_plan AS p ON q.query_id = p.query_id\n   JOIN sys.query_store_runtime_stats AS rs ON rs.plan_id = p.plan_id\n   JOIN sys.query_store_runtime_stats_interval AS rsi \n   ON rsi.runtime_stats_interval_id = rs.runtime_stats_interval_id\n   WHERE rsi.start_time >= DATEADD(hour, -1, GETUTCDATE()) \n   AND rs.execution_type_desc = 'Regular'\n   GROUP BY q.query_id\n)\n,OrderedDuration\nAS\n(\n   SELECT query_id, total_duration, number_of_plans, \n   ROW_NUMBER () OVER (ORDER BY total_duration DESC, query_id) AS RN\n   FROM AggregatedDurationLastHour\n)\nSELECT qt.query_sql_text, object_name(q.object_id) AS containing_object, q.query_id,\np.plan_id,rsi.start_time as interval_start, rs.avg_duration,\nCONVERT(xml, p.query_plan) AS query_plan_xml\nFROM OrderedDuration od JOIN sys.query_store_query AS q ON q.query_id  = od.query_id\nJOIN sys.query_store_query_text AS qt ON q.query_text_id = qt.query_text_id\nJOIN sys.query_store_plan AS p ON q.query_id = p.query_id\nJOIN sys.query_store_runtime_stats AS rs ON rs.plan_id = p.plan_id\nJOIN sys.query_store_runtime_stats_interval AS rsi ON rsi.runtime_stats_interval_id = rs.runtime_stats_interval_id\nWHERE rsi.start_time >= DATEADD(hour, -1, GETUTCDATE())\nAND OD.RN <=25 AND number_of_plans > 1\nORDER BY total_duration DESC, query_id, rsi.runtime_stats_interval_id, p.plan_id\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">This is the part of the obtained data set:<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><a href=\"https:\/\/acom.azurecomcdn.net\/80C57D\/blogmedia\/blogmedia\/2015\/06\/01\/Multiple-Plans-Query-Results.png\"><img decoding=\"async\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/06\/Multiple-Plans-Query-Results_thumb.webp\" alt=\"Query Store: A flight data recorder for your database\" style=\"width:981px;height:auto\" title=\"Query results for top resource consuming queries with multiple plans\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">From the data set you can observe that query id = 1 was executed with two plans that had different performance (additionally, you can click on&nbsp;<strong>query_plan_xml<\/strong>&nbsp;column in the result grid to visually inspect the difference). The plan with plan id = 1 (green rectangles) shows on average 2-3 better performance (i.e. less&nbsp;<strong>avg_duration<\/strong>), than plan id =2 (red rectangles)<em>&nbsp;for every measurement interval<\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Therefore, you will likely want to enforce plan id = 1 for query id = 1:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nEXEC sys.sp_query_store_force_plan @query_id = 1, @plan_id = 1;\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"next-steps\">Next steps<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For more detailed information about Query Store, check out our online <a href=\"https:\/\/aka.ms\/querystore\">preview documentation<\/a> and <a href=\"https:\/\/channel9.msdn.com\/Shows\/Data-Exposed\/Query-Store-in-SQL-Server-2016\" target=\"_blank\" rel=\"noreferrer noopener\">Channel 9 discussion<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Please post your questions and comments below \u2013 we\u2019re eager to hear your feedback to help improve the feature going forward.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post will help you get started using Query Store for query performance analysis.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ms_queue_id":[],"ep_exclude_from_search":false,"_classifai_error":"","_classifai_text_to_speech_error":"","_alt_title":"","footnotes":"","msx_community_cta_settings":[]},"categories":[1473,1466],"tags":[],"audience":[3057,3055,3053,3056],"content-type":[1511],"product":[1539],"tech-community":[],"topic":[],"coauthors":[707],"class_list":["post-5403","post","type-post","status-publish","format-standard","hentry","category-databases","category-hybrid-multicloud","audience-data-professionals","audience-developers","audience-it-decision-makers","audience-it-implementors","content-type-best-practices","product-azure-sql-database","review-flag-1680286581-295","review-flag-1-1680286581-825","review-flag-2-1680286581-601","review-flag-3-1680286581-173","review-flag-9-1680286581-259","review-flag-new-1680286579-546"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Query Store: A flight data recorder for your database | Microsoft Azure Blog<\/title>\n<meta name=\"description\" content=\"This post will help you get started using Query Store for query performance analysis.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/azure.microsoft.com\/en-us\/blog\/query-store-a-flight-data-recorder-for-your-database\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Query Store: A flight data recorder for your database | Microsoft Azure Blog\" \/>\n<meta property=\"og:description\" content=\"This post will help you get started using Query Store for query performance analysis.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/azure.microsoft.com\/en-us\/blog\/query-store-a-flight-data-recorder-for-your-database\/\" \/>\n<meta property=\"og:site_name\" content=\"Microsoft Azure Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/microsoftazure\" \/>\n<meta property=\"article:published_time\" content=\"2015-06-08T00:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-17T15:57:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/06\/Query-Store-Properties_thumb.png\" \/>\n<meta name=\"author\" content=\"Borko Novakovic\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@azure\" \/>\n<meta name=\"twitter:site\" content=\"@azure\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Borko Novakovic\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/query-store-a-flight-data-recorder-for-your-database\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/query-store-a-flight-data-recorder-for-your-database\\\/\"},\"author\":[{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/author\\\/borko-novakovic\\\/\",\"@type\":\"Person\",\"@name\":\"Borko Novakovic\"}],\"headline\":\"Query Store: A flight data recorder for your database\",\"datePublished\":\"2015-06-08T00:00:00+00:00\",\"dateModified\":\"2025-09-17T15:57:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/query-store-a-flight-data-recorder-for-your-database\\\/\"},\"wordCount\":1179,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/query-store-a-flight-data-recorder-for-your-database\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/06\\\/Query-Store-Properties_thumb.png\",\"articleSection\":[\"Databases\",\"Hybrid + multicloud\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/query-store-a-flight-data-recorder-for-your-database\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/query-store-a-flight-data-recorder-for-your-database\\\/\",\"url\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/query-store-a-flight-data-recorder-for-your-database\\\/\",\"name\":\"Query Store: A flight data recorder for your database | Microsoft Azure Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/query-store-a-flight-data-recorder-for-your-database\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/query-store-a-flight-data-recorder-for-your-database\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/06\\\/Query-Store-Properties_thumb.png\",\"datePublished\":\"2015-06-08T00:00:00+00:00\",\"dateModified\":\"2025-09-17T15:57:12+00:00\",\"description\":\"This post will help you get started using Query Store for query performance analysis.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/query-store-a-flight-data-recorder-for-your-database\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/query-store-a-flight-data-recorder-for-your-database\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/query-store-a-flight-data-recorder-for-your-database\\\/#primaryimage\",\"url\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/06\\\/Query-Store-Properties_thumb.webp\",\"contentUrl\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/wp-content\\\/uploads\\\/2015\\\/06\\\/Query-Store-Properties_thumb.webp\",\"width\":480,\"height\":397,\"caption\":\"graphical user interface, chart, bubble chart\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/query-store-a-flight-data-recorder-for-your-database\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog home\",\"item\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Databases\",\"item\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/category\\\/databases\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Query Store: A flight data recorder for your database\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/\",\"name\":\"Microsoft Azure Blog\",\"description\":\"Get the latest Azure news, updates, and announcements from the Azure blog. From product updates to hot topics, hear from the Azure experts.\",\"publisher\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/#organization\",\"name\":\"Microsoft Azure Blog\",\"url\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/microsoft_logo.webp\",\"contentUrl\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/microsoft_logo.webp\",\"width\":512,\"height\":512,\"caption\":\"Microsoft Azure Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/microsoftazure\",\"https:\\\/\\\/x.com\\\/azure\",\"https:\\\/\\\/www.instagram.com\\\/microsoftdeveloper\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/16188386\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/windowsazure\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/#\\\/schema\\\/person\\\/c702e5edd662b328b49b7e1180cab117\",\"name\":\"shakir\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g7664e653ea371ce16eaf75e9fa8952c4\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g\",\"caption\":\"shakir\"},\"sameAs\":[\"https:\\\/\\\/azure.microsoft.com\"],\"url\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/author\\\/shakir\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Query Store: A flight data recorder for your database | Microsoft Azure Blog","description":"This post will help you get started using Query Store for query performance analysis.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/azure.microsoft.com\/en-us\/blog\/query-store-a-flight-data-recorder-for-your-database\/","og_locale":"en_US","og_type":"article","og_title":"Query Store: A flight data recorder for your database | Microsoft Azure Blog","og_description":"This post will help you get started using Query Store for query performance analysis.","og_url":"https:\/\/azure.microsoft.com\/en-us\/blog\/query-store-a-flight-data-recorder-for-your-database\/","og_site_name":"Microsoft Azure Blog","article_publisher":"https:\/\/www.facebook.com\/microsoftazure","article_published_time":"2015-06-08T00:00:00+00:00","article_modified_time":"2025-09-17T15:57:12+00:00","og_image":[{"url":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/06\/Query-Store-Properties_thumb.png","type":"","width":"","height":""}],"author":"Borko Novakovic","twitter_card":"summary_large_image","twitter_creator":"@azure","twitter_site":"@azure","twitter_misc":{"Written by":"Borko Novakovic","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/query-store-a-flight-data-recorder-for-your-database\/#article","isPartOf":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/query-store-a-flight-data-recorder-for-your-database\/"},"author":[{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/author\/borko-novakovic\/","@type":"Person","@name":"Borko Novakovic"}],"headline":"Query Store: A flight data recorder for your database","datePublished":"2015-06-08T00:00:00+00:00","dateModified":"2025-09-17T15:57:12+00:00","mainEntityOfPage":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/query-store-a-flight-data-recorder-for-your-database\/"},"wordCount":1179,"commentCount":0,"publisher":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization"},"image":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/query-store-a-flight-data-recorder-for-your-database\/#primaryimage"},"thumbnailUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/06\/Query-Store-Properties_thumb.png","articleSection":["Databases","Hybrid + multicloud"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/azure.microsoft.com\/en-us\/blog\/query-store-a-flight-data-recorder-for-your-database\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/query-store-a-flight-data-recorder-for-your-database\/","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/query-store-a-flight-data-recorder-for-your-database\/","name":"Query Store: A flight data recorder for your database | Microsoft Azure Blog","isPartOf":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/query-store-a-flight-data-recorder-for-your-database\/#primaryimage"},"image":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/query-store-a-flight-data-recorder-for-your-database\/#primaryimage"},"thumbnailUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/06\/Query-Store-Properties_thumb.png","datePublished":"2015-06-08T00:00:00+00:00","dateModified":"2025-09-17T15:57:12+00:00","description":"This post will help you get started using Query Store for query performance analysis.","breadcrumb":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/query-store-a-flight-data-recorder-for-your-database\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/azure.microsoft.com\/en-us\/blog\/query-store-a-flight-data-recorder-for-your-database\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/query-store-a-flight-data-recorder-for-your-database\/#primaryimage","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/06\/Query-Store-Properties_thumb.webp","contentUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2015\/06\/Query-Store-Properties_thumb.webp","width":480,"height":397,"caption":"graphical user interface, chart, bubble chart"},{"@type":"BreadcrumbList","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/query-store-a-flight-data-recorder-for-your-database\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog home","item":"https:\/\/azure.microsoft.com\/en-us\/blog\/"},{"@type":"ListItem","position":2,"name":"Databases","item":"https:\/\/azure.microsoft.com\/en-us\/blog\/category\/databases\/"},{"@type":"ListItem","position":3,"name":"Query Store: A flight data recorder for your database"}]},{"@type":"WebSite","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#website","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/","name":"Microsoft Azure Blog","description":"Get the latest Azure news, updates, and announcements from the Azure blog. From product updates to hot topics, hear from the Azure experts.","publisher":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/azure.microsoft.com\/en-us\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization","name":"Microsoft Azure Blog","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2024\/06\/microsoft_logo.webp","contentUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2024\/06\/microsoft_logo.webp","width":512,"height":512,"caption":"Microsoft Azure Blog"},"image":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/microsoftazure","https:\/\/x.com\/azure","https:\/\/www.instagram.com\/microsoftdeveloper\/","https:\/\/www.linkedin.com\/company\/16188386","https:\/\/www.youtube.com\/user\/windowsazure"]},{"@type":"Person","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/person\/c702e5edd662b328b49b7e1180cab117","name":"shakir","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g7664e653ea371ce16eaf75e9fa8952c4","url":"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g","caption":"shakir"},"sameAs":["https:\/\/azure.microsoft.com"],"url":"https:\/\/azure.microsoft.com\/en-us\/blog\/author\/shakir\/"}]}},"msxcm_animated_featured_image":null,"bloginabox_display_generated_audio":false,"distributor_meta":false,"distributor_terms":false,"distributor_media":false,"distributor_original_site_name":"Microsoft Azure Blog","distributor_original_site_url":"https:\/\/azure.microsoft.com\/en-us\/blog","push-errors":false,"_links":{"self":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/posts\/5403","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/comments?post=5403"}],"version-history":[{"count":1,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/posts\/5403\/revisions"}],"predecessor-version":[{"id":46441,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/posts\/5403\/revisions\/46441"}],"wp:attachment":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/media?parent=5403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/categories?post=5403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/tags?post=5403"},{"taxonomy":"audience","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/audience?post=5403"},{"taxonomy":"content-type","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/content-type?post=5403"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/product?post=5403"},{"taxonomy":"tech-community","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/tech-community?post=5403"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/topic?post=5403"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/coauthors?post=5403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}