{"id":45011,"date":"2024-12-01T16:31:37","date_gmt":"2024-12-01T08:31:37","guid":{"rendered":"https:\/\/fwq.ai\/blog\/45011\/"},"modified":"2024-12-01T16:31:37","modified_gmt":"2024-12-01T08:31:37","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-mysql-%e7%bb%9f%e8%ae%a1%e8%a7%a3%e6%9e%90%e5%a4%b1%e8%b4%a5%e7%8e%87%ef%bc%9f-3","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/45011\/","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 MySQL \u7edf\u8ba1\u89e3\u6790\u5931\u8d25\u7387\uff1f"},"content":{"rendered":"<p><b><\/b> <\/p>\n<h1>\u5982\u4f55\u4f7f\u7528 MySQL \u7edf\u8ba1\u89e3\u6790\u5931\u8d25\u7387\uff1f<\/h1>\n<p>\u5728IT\u884c\u4e1a\u8fd9\u4e2a\u53d1\u5c55\u66f4\u65b0\u901f\u5ea6\u5f88\u5feb\u7684\u884c\u4e1a\uff0c\u53ea\u6709\u4e0d\u505c\u6b62\u7684\u5b66\u4e60\uff0c\u624d\u4e0d\u4f1a\u88ab\u884c\u4e1a\u6240\u6dd8\u6c70\u3002\u5982\u679c\u4f60\u662f\u6570\u636e\u5e93\u5b66\u4e60\u8005\uff0c\u90a3\u4e48\u672c\u6587\u300a\u5982\u4f55\u4f7f\u7528 MySQL \u7edf\u8ba1\u89e3\u6790\u5931\u8d25\u7387\uff1f\u300b\u5c31\u5f88\u9002\u5408\u4f60\uff01\u672c\u7bc7\u5185\u5bb9\u4e3b\u8981\u5305\u62ec##content_title##\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u7684\u77e5\u8bc6\u79ef\u7d2f\u6709\u6240\u5e2e\u52a9\uff0c\u52a9\u529b\u5b9e\u6218\u5f00\u53d1\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241105\/17307853616729b051ceac0.jpg\" class=\"aligncenter\" title=\"\u5982\u4f55\u4f7f\u7528 MySQL \u7edf\u8ba1\u89e3\u6790\u5931\u8d25\u7387\uff1f\u63d2\u56fe\" alt=\"\u5982\u4f55\u4f7f\u7528 MySQL \u7edf\u8ba1\u89e3\u6790\u5931\u8d25\u7387\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528 mysql \u7edf\u8ba1\u89e3\u6790\u5931\u8d25\u7387<\/strong><\/p>\n<p>\u5728\u6570\u636e\u5e93\u8868\u4e2d\u8bb0\u5f55\u4e86\u591a\u4e2a\u76d1\u6d4b\u5bf9\u8c61\u7684\u89e3\u6790\u8bb0\u5f55\uff0c\u5176\u4e2d\u5b57\u6bb5 track_source_id \u8868\u793a\u76d1\u6d4b\u5bf9\u8c61\uff0cis_parsed \u8868\u793a\u89e3\u6790\u6210\u529f\u4e0e\u5426\u3002\u73b0\u5728\u9700\u8981\u7edf\u8ba1\u6bcf\u4e2a\u76d1\u6d4b\u5bf9\u8c61\u7684\u89e3\u6790\u5931\u8d25\u7387\u3002<\/p>\n<p>\u9488\u5bf9\u6b64\u9700\u6c42\uff0c\u53ef\u4ee5\u7f16\u5199\u4ee5\u4e0b sql \u67e5\u8be2\uff1a<\/p>\n<pre>SELECT track_source_id, 1 - SUM(is_parsed) \/ COUNT(*)\nFROM parse_monitoring\nGROUP BY track_source_id<\/pre>\n<p>\u5176\u4e2d\uff1a<\/p>\n<ul>\n<li>sum(is_parsed) \u8ba1\u7b97\u6bcf\u4e2a\u76d1\u6d4b\u5bf9\u8c61\u89e3\u6790\u6210\u529f\u7684\u6b21\u6570\u3002<\/li>\n<li>count(*) \u8ba1\u7b97\u6bcf\u4e2a\u76d1\u6d4b\u5bf9\u8c61\u7684\u603b\u89e3\u6790\u6b21\u6570\u3002<\/li>\n<li>1 &#8211; sum(is_parsed) \/ count(*) \u8ba1\u7b97\u89e3\u6790\u5931\u8d25\u7387\uff0c\u5373\u89e3\u6790\u6210\u529f\u6b21\u6570\u4e0e\u603b\u89e3\u6790\u6b21\u6570\u4e4b\u6bd4\u7684\u5dee\u503c\u3002<\/li>\n<\/ul>\n<p>\u6267\u884c\u6b64\u67e5\u8be2\u5c06\u8fd4\u56de\u6bcf\u4e2a\u76d1\u6d4b\u5bf9\u8c61\u7684 track_source_id \u548c\u89e3\u6790\u5931\u8d25\u7387\u3002<\/p>\n<p>\u4eca\u5929\u5e26\u5927\u5bb6\u4e86\u89e3\u4e86\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u5e0c\u671b\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff1b\u5173\u4e8e\u6570\u636e\u5e93\u7684\u6280\u672f\u77e5\u8bc6\u6211\u4eec\u4f1a\u4e00\u70b9\u70b9\u6df1\u5165\u4ecb\u7ecd\uff0c\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff0c\u4e00\u8d77\u5b66\u4e60\u7f16\u7a0b~<\/p>\n<dl>\n<dt>\n <\/dt>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4f7f\u7528 MySQL \u7edf\u8ba1\u89e3\u6790\u5931\u8d25\u7387\uff1f \u5728IT\u884c\u4e1a\u8fd9\u4e2a\u53d1\u5c55\u66f4\u65b0\u901f\u5ea6\u5f88\u5feb\u7684\u884c\u4e1a\uff0c\u53ea\u6709\u4e0d\u505c\u6b62\u7684\u5b66\u4e60\uff0c\u624d\u4e0d\u4f1a\u88ab\u884c\u4e1a\u6240\u6dd8\u6c70\u3002\u5982\u679c\u4f60\u662f\u6570\u636e\u5e93\u5b66\u4e60\u8005\uff0c\u90a3\u4e48\u672c\u6587\u300a\u5982\u4f55\u4f7f\u7528 MySQL \u7edf\u8ba1\u89e3\u6790\u5931\u8d25\u7387\uff1f\u300b\u5c31\u5f88\u9002\u5408\u4f60\uff01\u672c\u7bc7\u5185\u5bb9\u4e3b\u8981\u5305\u62ec##content_title##\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u7684\u77e5\u8bc6\u79ef\u7d2f\u6709\u6240\u5e2e\u52a9\uff0c\u52a9\u529b\u5b9e\u6218\u5f00\u53d1\uff01 \u5982\u4f55\u4f7f\u7528 mysql \u7edf\u8ba1\u89e3\u6790\u5931\u8d25\u7387 \u5728\u6570\u636e\u5e93\u8868\u4e2d\u8bb0\u5f55\u4e86\u591a\u4e2a\u76d1\u6d4b\u5bf9\u8c61\u7684\u89e3\u6790\u8bb0\u5f55\uff0c\u5176\u4e2d\u5b57\u6bb5 track_source_id \u8868\u793a\u76d1\u6d4b\u5bf9\u8c61\uff0cis_parsed \u8868\u793a\u89e3\u6790\u6210\u529f\u4e0e\u5426\u3002\u73b0\u5728\u9700\u8981\u7edf\u8ba1\u6bcf\u4e2a\u76d1\u6d4b\u5bf9\u8c61\u7684\u89e3\u6790\u5931\u8d25\u7387\u3002 \u9488\u5bf9\u6b64\u9700\u6c42\uff0c\u53ef\u4ee5\u7f16\u5199\u4ee5\u4e0b sql \u67e5\u8be2\uff1a SELECT track_source_id, 1 &#8211; SUM(is_parsed) \/ COUNT(*) FROM parse_monitoring GROUP BY track_source_id \u5176\u4e2d\uff1a sum(is_parsed) \u8ba1\u7b97\u6bcf\u4e2a\u76d1\u6d4b\u5bf9\u8c61\u89e3\u6790\u6210\u529f\u7684\u6b21\u6570\u3002 count(*) \u8ba1\u7b97\u6bcf\u4e2a\u76d1\u6d4b\u5bf9\u8c61\u7684\u603b\u89e3\u6790\u6b21\u6570\u3002 1 &#8211; sum(is_parsed) \/ count(*) \u8ba1\u7b97\u89e3\u6790\u5931\u8d25\u7387\uff0c\u5373\u89e3\u6790\u6210\u529f\u6b21\u6570\u4e0e\u603b\u89e3\u6790\u6b21\u6570\u4e4b\u6bd4\u7684\u5dee\u503c\u3002 \u6267\u884c\u6b64\u67e5\u8be2\u5c06\u8fd4\u56de\u6bcf\u4e2a\u76d1\u6d4b\u5bf9\u8c61\u7684 track_source_id \u548c\u89e3\u6790\u5931\u8d25\u7387\u3002 \u4eca\u5929\u5e26\u5927\u5bb6\u4e86\u89e3\u4e86\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u5e0c\u671b\u5bf9\u4f60\u6709\u6240\u5e2e\u52a9\uff1b\u5173\u4e8e\u6570\u636e\u5e93\u7684\u6280\u672f\u77e5\u8bc6\u6211\u4eec\u4f1a\u4e00\u70b9\u70b9\u6df1\u5165\u4ecb\u7ecd\uff0c\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\uff0c\u4e00\u8d77\u5b66\u4e60\u7f16\u7a0b~<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-45011","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/45011","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=45011"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/45011\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=45011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=45011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=45011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}