{"id":6258,"date":"2019-03-07T08:09:07","date_gmt":"2019-03-07T08:09:07","guid":{"rendered":"https:\/\/ittutorial.org\/?p=6258"},"modified":"2019-11-28T07:06:59","modified_gmt":"2019-11-28T07:06:59","slug":"sql-server-performance-top-io-query","status":"publish","type":"post","link":"https:\/\/ittutorial.org\/sql-server-performance-top-io-query\/","title":{"rendered":"SQL Server Performance TOP IO Query -1"},"content":{"rendered":"<p>Hi,<\/p>\n<p>If you got slowness complaint from customer,\u00a0 you need to monitor SQL Server Instance and database which sql is consuming a lots of resource.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6247\" src=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/03\/sql-server.png\" alt=\"\" width=\"466\" height=\"383\" srcset=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/03\/sql-server.png 466w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/03\/sql-server-300x247.png 300w\" sizes=\"auto, (max-width: 466px) 100vw, 466px\" \/><\/p>\n<p><!--more--><\/p>\n\n<p>&nbsp;<\/p>\n<p>SQL Server DBA should monitor database everytime and if there are many sqls which is running long execution time or\u00a0consuming a lots of IO resource then it should be reported to the developer and developer and dba should examine these sqls.<\/p>\n<p>&nbsp;<\/p>\n<p>You can find TOP IOqueries in SQL Server database with following query.<\/p>\n<pre>\u00a0  select \r\n       SUBSTRING(st.text,(qs.statement_start_offset\/2)+1,\r\n       ((case statement_end_offset\r\n          when -1 then DATALENGTH(st.text)\r\n          else qs.statement_end_offset end\r\n          - qs.statement_start_offset)\/2) +1) as statement_text,\r\n          qs.total_logical_reads,\r\n          qs.total_physical_reads,\r\n          qs.execution_count\r\n      from sys.dm_exec_query_stats as qs\r\n   cross apply sys.dm_exec_sql_text(qs.sql_handle) as st \r\norder by qs.total_logical_reads desc, qs.execution_count desc<\/pre>\n<p>&nbsp;<\/p>\n\n<p>Query result will be like following screenshot<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6259\" src=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/03\/sql-server2.png\" alt=\"\" width=\"821\" height=\"348\" srcset=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/03\/sql-server2.png 821w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/03\/sql-server2-300x127.png 300w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/03\/sql-server2-768x326.png 768w\" sizes=\"auto, (max-width: 821px) 100vw, 821px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h4><span style=\"color: #ff0000;\">Do you want to learn Microsoft SQL Server DBA Tutorials for Beginners, then read the following articles.<\/span><\/h4>\n<p><a href=\"https:\/\/ittutorial.org\/sql-server-tutorials-microsoft-database-for-beginners\/\">https:\/\/ittutorial.org\/sql-server-tutorials-microsoft-database-for-beginners\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, If you got slowness complaint from customer,\u00a0 you need to monitor SQL Server Instance and database which sql is consuming a lots of resource.<\/p>\n","protected":false},"author":1,"featured_media":6247,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3828,2227,3827],"tags":[1028,1031,1600,1610,2231,2243,2238,2244,2246,2237,2240,2239,2245,2241,2242,2230,2229],"class_list":["post-6258","post","type-post","status-publish","format-standard","has-post-thumbnail","","category-sql-scripts","category-sql-server-2","category-sql-server-dba-scripts","tag-mehmet-deveci","tag-mehmet-salih-deveci","tag-sql-server-2012","tag-sql-server-2014","tag-sql-server-2019","tag-sql-server-performance-scripts","tag-sql-server-performance-top-cpu-query","tag-sql-server-performance-top-io-query","tag-sql-server-scripts","tag-sql-server-select-inventory","tag-sql-server-top-cpu","tag-sql-server-top-cpu-query","tag-sql-server-top-io-query","tag-sql-server-top-queries","tag-sql-server-top-query","tag-sql-server-useful-query","tag-sql-server-useful-script"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/03\/sql-server.png","jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/6258","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/comments?post=6258"}],"version-history":[{"count":3,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/6258\/revisions"}],"predecessor-version":[{"id":12977,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/6258\/revisions\/12977"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/media\/6247"}],"wp:attachment":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/media?parent=6258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/categories?post=6258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/tags?post=6258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}