{"id":651,"date":"2010-10-01T08:38:20","date_gmt":"2010-10-01T08:38:20","guid":{"rendered":"http:\/\/enjoyasp.net\/?p=651"},"modified":"2011-03-15T11:33:53","modified_gmt":"2011-03-15T11:33:53","slug":"%e6%b5%8b%e8%af%95sql%e8%af%ad%e5%8f%a5%e6%89%a7%e8%a1%8c%e9%80%9f%e5%ba%a6","status":"publish","type":"post","link":"https:\/\/enjoyasp.net\/index.php\/2010\/10\/01\/%e6%b5%8b%e8%af%95sql%e8%af%ad%e5%8f%a5%e6%89%a7%e8%a1%8c%e9%80%9f%e5%ba%a6\/","title":{"rendered":"\u6d4b\u8bd5SQL\u8bed\u53e5\u6267\u884c\u901f\u5ea6"},"content":{"rendered":"<pre lang=\"tsql\">\r\n1\uff0c DECLARE @time DATETIME\r\nSET @time = GETDATE()\r\n --------\u6267\u884csql\u8bed\u53e5------\r\nselect datediff(ms,@time,getdate()) --\u6253\u5370\u7ed3\u679c\r\n\r\n2\uff0c\r\nSET STATISTICS TIME ON\r\n    SELECT * FROM bdOrder b(NOLOCK)\r\n    JOIN bmdCustomer c(NOLOCK) ON b.CustomerID = c.ID\r\n    WHERE B.OrderDate >='2011-03-15'\r\nSET STATISTICS TIME OFF\r\n\u65f6\u95f4\u5206\u4e3a\u4e24\u4e2a\u90e8\u5206\uff0c\u4e00\u4e2a\u662fSQL\u8bed\u53e5\u7684\u5206\u6790\u4e0e\u7f16\u8bd1\u65f6\u95f4\uff0c\u4e00\u4e2a\u662f\u5b9e\u9645\u6267\u884c\u65f6\u95f4elapsed time\r\nCPU\u65f6\u95f4\uff1a\u6307CPU\u8c03\u5ea6\u65f6\u95f4\uff0c\u5360\u7528\u65f6\u95f4\u6307\u6267\u884c\u65f6\u95f4\r\n\u6267\u884c\u4e0a\u8ff0\u5c06\u8fd4\u56de\uff1a\r\nSQL Server \u5206\u6790\u548c\u7f16\u8bd1\u65f6\u95f4:\r\n   CPU \u65f6\u95f4 = 0 \u6beb\u79d2\uff0c\u5360\u7528\u65f6\u95f4 = 0 \u6beb\u79d2\u3002\r\n\r\n(2460 \u884c\u53d7\u5f71\u54cd)\r\n\r\nSQL Server \u6267\u884c\u65f6\u95f4:\r\n   CPU \u65f6\u95f4 = 31 \u6beb\u79d2\uff0c\u5360\u7528\u65f6\u95f4 = 327 \u6beb\u79d2\u3002\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1\uff0c DECLARE @time DATETIME SET @time = GETDATE() &#8212;&#8212;- [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-651","post","type-post","status-publish","format-standard","hentry","category-sql-server"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts\/651","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/comments?post=651"}],"version-history":[{"count":0,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts\/651\/revisions"}],"wp:attachment":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/media?parent=651"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/categories?post=651"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/tags?post=651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}