{"id":468,"date":"2025-07-09T08:25:41","date_gmt":"2025-07-08T23:25:41","guid":{"rendered":"https:\/\/sejiwon.com\/?p=468"},"modified":"2025-07-09T08:30:31","modified_gmt":"2025-07-08T23:30:31","slug":"%ed%95%b4%eb%8b%b9-%ec%bf%bc%eb%a6%ac%ea%b0%80-%eb%94%94%ec%8a%a4%ed%81%aci-o-%eb%85%bc%eb%a6%aci-o-elapsetime-%eb%93%b1%ec%9d%84-%ed%99%95%ec%9d%b8%ed%95%98%eb%8a%94-%ec%bf%bc%eb%a6%ac","status":"publish","type":"post","link":"https:\/\/sejiwon.com\/?p=468","title":{"rendered":"\ud574\ub2f9 \ucffc\ub9ac\uac00 \ub514\uc2a4\ud06ci\/o \ub17c\ub9aci\/o elapsetime \ub4f1\uc744 \ud655\uc778\ud558\ub294 \ucffc\ub9ac"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\u2705 1. <strong>\ub514\uc2a4\ud06c I\/O (Physical I\/O)<\/strong><\/h3>\n\n\n\n<p><code>sys.dm_io_virtual_file_stats<\/code>\ub97c \uc0ac\uc6a9 \u2014 <strong>\ud30c\uc77c \uc218\uc900\uc758 I\/O (\uc77d\uae30\/\uc4f0\uae30 \ud69f\uc218 \ubc0f \ub300\uae30 \uc2dc\uac04)<\/strong>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 2. <strong>\ub17c\ub9ac I\/O (Logical I\/O)<\/strong><\/h3>\n\n\n\n<p>\ucffc\ub9ac \uc2e4\ud589 \uc2dc \ubc1c\uc0dd\ud55c <strong>\ud398\uc774\uc9c0 \uc77d\uae30 \ud69f\uc218<\/strong>\ub294 <code>SET STATISTICS IO ON<\/code>\uc73c\ub85c \ud655\uc778 \uac00\ub2a5\ud569\ub2c8\ub2e4. \uc608:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>SET STATISTICS IO ON;\nSET STATISTICS TIME ON;\n\n-- \uc5ec\uae30\uc5d0 \uc2e4\ud589\ud560 \ucffc\ub9ac\nSELECT * FROM YourTable WHERE YourCondition;\n\nSET STATISTICS IO OFF;\nSET STATISTICS TIME OFF;\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\uacb0\uacfc \uc608:<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>Table 'YourTable'. Scan count 1, logical reads 500, physical reads 5, read-ahead reads 10\nSQL Server Execution Times:\n   CPU time = 50 ms,  elapsed time = 200 ms.\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 3. <strong>\uc2e4\ud589 \uacc4\ud68d \uae30\ubc18 \uc0c1\uc138 \ubd84\uc11d (Elapsed Time, Logical Reads, CPU Time)<\/strong><\/h3>\n\n\n\n<p>\uc774 \ucffc\ub9ac\ub294 \ucd5c\uadfc \uc2e4\ud589\ub41c \ucffc\ub9ac\ub4e4\uc758 \uc131\ub2a5 \uba54\ud2b8\ub9ad\uc744 \ubcf4\uc5ec\uc90d\ub2c8\ub2e4:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>SELECT\n    DB_NAME(st.dbid) AS database_name,\n    OBJECT_NAME(st.objectid, st.dbid) AS object_name,\n    qs.total_elapsed_time \/ qs.execution_count AS avg_elapsed_time_ms,\n    qs.total_logical_reads \/ qs.execution_count AS avg_logical_reads,\n    qs.total_physical_reads \/ qs.execution_count AS avg_physical_reads,\n    qs.execution_count,\n    qs.total_worker_time \/ qs.execution_count AS avg_cpu_time,\n    st.text AS query_text\nFROM sys.dm_exec_query_stats AS qs\nCROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS st\nORDER BY qs.total_elapsed_time DESC;\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u2705 4. <strong>\uc694\uc57d<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\uba54\ud2b8\ub9ad<\/th><th>\ud655\uc778 \ubc29\ubc95<\/th><\/tr><\/thead><tbody><tr><td><strong>\ub514\uc2a4\ud06c I\/O<\/strong><\/td><td><code>sys.dm_io_virtual_file_stats<\/code><\/td><\/tr><tr><td><strong>\ub17c\ub9ac I\/O<\/strong><\/td><td><code>SET STATISTICS IO ON<\/code> + \uc2e4\ud589<\/td><\/tr><tr><td><strong>Elapsed Time \/ CPU Time<\/strong><\/td><td><code>sys.dm_exec_query_stats<\/code> \uc0ac\uc6a9<\/td><\/tr><tr><td><strong>\uc2e4\uc2dc\uac04 \ubaa8\ub2c8\ud130\ub9c1<\/strong><\/td><td><code>sys.dm_exec_requests<\/code>, Extended Events \ub4f1<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u2705 1. \ub514\uc2a4\ud06c I\/O (Physical I\/O) sys.dm_io_virtual_file_stats\ub97c \uc0ac\uc6a9 \u2014 \ud30c\uc77c \uc218\uc900\uc758 I\/O (\uc77d\uae30\/\uc4f0\uae30 \ud69f\uc218 \ubc0f \ub300\uae30 \uc2dc\uac04). \u2705 2. \ub17c\ub9ac I\/O (Logical I\/O) \ucffc\ub9ac \uc2e4\ud589 \uc2dc \ubc1c\uc0dd\ud55c \ud398\uc774\uc9c0 \uc77d\uae30 \ud69f\uc218\ub294 SET STATISTICS IO ON\uc73c\ub85c \ud655\uc778 \uac00\ub2a5\ud569\ub2c8\ub2e4. \uc608: SET STATISTICS IO ON; SET STATISTICS TIME ON; &#8212; \uc5ec\uae30\uc5d0 \uc2e4\ud589\ud560 \ucffc\ub9ac SELECT * FROM YourTable WHERE YourCondition;\u2026 <span class=\"read-more\"><a href=\"https:\/\/sejiwon.com\/?p=468\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[11],"tags":[],"_links":{"self":[{"href":"https:\/\/sejiwon.com\/index.php?rest_route=\/wp\/v2\/posts\/468"}],"collection":[{"href":"https:\/\/sejiwon.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sejiwon.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sejiwon.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sejiwon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=468"}],"version-history":[{"count":2,"href":"https:\/\/sejiwon.com\/index.php?rest_route=\/wp\/v2\/posts\/468\/revisions"}],"predecessor-version":[{"id":476,"href":"https:\/\/sejiwon.com\/index.php?rest_route=\/wp\/v2\/posts\/468\/revisions\/476"}],"wp:attachment":[{"href":"https:\/\/sejiwon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sejiwon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sejiwon.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}