{"id":97226,"date":"2024-10-20T16:03:18","date_gmt":"2024-10-20T08:03:18","guid":{"rendered":"https:\/\/server.hk\/cnblog\/97226\/"},"modified":"2024-10-20T16:03:19","modified_gmt":"2024-10-20T08:03:19","slug":"redis-hyperloglog-%e6%98%af%e4%bb%80%e9%ba%bc%ef%bc%9f%e9%80%99%e4%ba%9b%e5%a0%b4%e6%99%af%e4%bd%bf%e7%94%a8%e5%ae%83%ef%bc%8c%e8%ae%93%e6%88%91%e6%a7%8d%e5%87%ba%e5%a6%82%e9%be%8d%ef%bc%8c%e4%b8%80","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/97226\/","title":{"rendered":"Redis HyperLogLog \u662f\u4ec0\u9ebc\uff1f\u9019\u4e9b\u5834\u666f\u4f7f\u7528\u5b83\uff0c\u8b93\u6211\u69cd\u51fa\u5982\u9f8d\uff0c\u4e00\u7b11\u7834\u84bc\u7a79"},"content":{"rendered":"<h1 id=\"redis-hyperloglog-%e6%98%af%e4%bb%80%e9%ba%bc%ef%bc%9f%e9%80%99%e4%ba%9b%e5%a0%b4%e6%99%af%e4%bd%bf%e7%94%a8%e5%ae%83%ef%bc%8c%e8%ae%93%e6%88%91%e6%a7%8d%e5%87%ba%e5%a6%82%e9%be%8d%ef%bc%8c%e4%b8%80-HQcMhtLVLR\">Redis HyperLogLog \u662f\u4ec0\u9ebc\uff1f\u9019\u4e9b\u5834\u666f\u4f7f\u7528\u5b83\uff0c\u8b93\u6211\u69cd\u51fa\u5982\u9f8d\uff0c\u4e00\u7b11\u7834\u84bc\u7a79<\/h1>\n<p>\u5728\u7576\u4eca\u7684\u6578\u64da\u9a45\u52d5\u4e16\u754c\u4e2d\uff0c\u5982\u4f55\u6709\u6548\u5730\u8655\u7406\u548c\u5206\u6790\u5927\u91cf\u6578\u64da\u6210\u70ba\u4e86\u4f01\u696d\u7684\u4e00\u5927\u6311\u6230\u3002Redis \u4f5c\u70ba\u4e00\u500b\u9ad8\u6548\u7684\u6578\u64da\u7d50\u69cb\u4f3a\u670d\u5668\uff0c\u63d0\u4f9b\u4e86\u591a\u7a2e\u6578\u64da\u7d50\u69cb\u4f86\u6eff\u8db3\u4e0d\u540c\u7684\u9700\u6c42\u3002\u5176\u4e2d\uff0cHyperLogLog \u662f\u4e00\u7a2e\u975e\u5e38\u6709\u7528\u7684\u6578\u64da\u7d50\u69cb\uff0c\u5c08\u9580\u7528\u65bc\u4f30\u7b97\u552f\u4e00\u5143\u7d20\u7684\u6578\u91cf\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e Redis HyperLogLog \u7684\u539f\u7406\u3001\u7279\u9ede\u4ee5\u53ca\u5be6\u969b\u61c9\u7528\u5834\u666f\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af-hyperloglog%ef%bc%9f-HQcMhtLVLR\">\u4ec0\u9ebc\u662f HyperLogLog\uff1f<\/h2>\n<p>HyperLogLog \u662f\u4e00\u7a2e\u6982\u7387\u6027\u6578\u64da\u7d50\u69cb\uff0c\u4e3b\u8981\u7528\u65bc\u4f30\u7b97\u96c6\u5408\u4e2d\u552f\u4e00\u5143\u7d20\u7684\u6578\u91cf\u3002\u5b83\u7684\u512a\u52e2\u5728\u65bc\u80fd\u5920\u4ee5\u6975\u5c0f\u7684\u5167\u5b58\u4f54\u7528\u4f86\u8655\u7406\u5927\u898f\u6a21\u6578\u64da\u3002HyperLogLog \u7684\u6838\u5fc3\u601d\u60f3\u662f\u5229\u7528\u54c8\u5e0c\u51fd\u6578\u5c07\u5143\u7d20\u6620\u5c04\u5230\u4e00\u500b\u56fa\u5b9a\u5927\u5c0f\u7684\u4f4d\u5143\u7d44\u4e2d\uff0c\u7136\u5f8c\u6839\u64da\u9019\u4e9b\u4f4d\u5143\u7d44\u7684\u7279\u6027\u4f86\u4f30\u7b97\u552f\u4e00\u5143\u7d20\u7684\u6578\u91cf\u3002<\/p>\n<h2 id=\"hyperloglog-%e7%9a%84%e5%b7%a5%e4%bd%9c%e5%8e%9f%e7%90%86-HQcMhtLVLR\">HyperLogLog \u7684\u5de5\u4f5c\u539f\u7406<\/h2>\n<p>HyperLogLog \u7684\u5de5\u4f5c\u539f\u7406\u53ef\u4ee5\u7c21\u55ae\u6982\u8ff0\u70ba\u4ee5\u4e0b\u5e7e\u500b\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u7576\u4e00\u500b\u65b0\u5143\u7d20\u88ab\u6dfb\u52a0\u6642\uff0c\u9996\u5148\u901a\u904e\u54c8\u5e0c\u51fd\u6578\u5c07\u5176\u8f49\u63db\u70ba\u4e00\u500b\u4f4d\u5143\u4e32\u3002<\/li>\n<li>\u7136\u5f8c\uff0c\u6839\u64da\u4f4d\u5143\u4e32\u4e2d\u6700\u5de6\u908a\u7684 1 \u7684\u4f4d\u7f6e\u4f86\u66f4\u65b0 HyperLogLog \u7684\u5167\u90e8\u72c0\u614b\u3002<\/li>\n<li>\u9019\u500b\u904e\u7a0b\u6703\u91cd\u8907\u9032\u884c\uff0c\u76f4\u5230\u6240\u6709\u5143\u7d20\u90fd\u88ab\u8655\u7406\u5b8c\u7562\u3002<\/li>\n<li>\u6700\u5f8c\uff0c\u901a\u904e\u7279\u5b9a\u7684\u7b97\u6cd5\u4f86\u4f30\u7b97\u552f\u4e00\u5143\u7d20\u7684\u6578\u91cf\u3002<\/li>\n<\/ol>\n<p>\u9019\u7a2e\u65b9\u6cd5\u7684\u597d\u8655\u5728\u65bc\uff0c\u5373\u4f7f\u5728\u8655\u7406\u6578\u5341\u5104\u7684\u6578\u64da\u6642\uff0cHyperLogLog \u4e5f\u53ea\u9700\u5e7e KB \u7684\u5167\u5b58\uff0c\u9019\u4f7f\u5f97\u5b83\u5728\u5927\u6578\u64da\u74b0\u5883\u4e2d\u975e\u5e38\u9ad8\u6548\u3002<\/p>\n<h2 id=\"hyperloglog-%e7%9a%84%e7%89%b9%e9%bb%9e-HQcMhtLVLR\">HyperLogLog \u7684\u7279\u9ede<\/h2>\n<ul>\n<li><strong>\u5167\u5b58\u6548\u7387\u9ad8\uff1a<\/strong>HyperLogLog \u53ea\u9700\u5c11\u91cf\u5167\u5b58\u5373\u53ef\u4f30\u7b97\u5927\u91cf\u6578\u64da\u7684\u552f\u4e00\u5143\u7d20\u6578\u91cf\u3002<\/li>\n<li><strong>\u8a08\u7b97\u901f\u5ea6\u5feb\uff1a<\/strong>\u7531\u65bc\u5176\u6982\u7387\u6027\u7279\u5fb5\uff0cHyperLogLog \u7684\u8a08\u7b97\u901f\u5ea6\u975e\u5e38\u5feb\uff0c\u9069\u5408\u5be6\u6642\u6578\u64da\u8655\u7406\u3002<\/li>\n<li><strong>\u652f\u6301\u5408\u4f75\uff1a<\/strong>\u591a\u500b HyperLogLog \u53ef\u4ee5\u9032\u884c\u5408\u4f75\uff0c\u9019\u4f7f\u5f97\u5728\u5206\u4f48\u5f0f\u7cfb\u7d71\u4e2d\u975e\u5e38\u65b9\u4fbf\u3002<\/li>\n<\/ul>\n<h2 id=\"%e4%bd%bf%e7%94%a8%e5%a0%b4%e6%99%af-HQcMhtLVLR\">\u4f7f\u7528\u5834\u666f<\/h2>\n<p>HyperLogLog \u5728\u8a31\u591a\u5834\u666f\u4e2d\u90fd\u80fd\u767c\u63ee\u5176\u7368\u7279\u7684\u512a\u52e2\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u898b\u7684\u61c9\u7528\u5834\u666f\uff1a<\/p>\n<h3 id=\"1-%e7%b6%b2%e7%ab%99%e8%a8%aa%e5%95%8f%e9%87%8f%e7%b5%b1%e8%a8%88-HQcMhtLVLR\">1. \u7db2\u7ad9\u8a2a\u554f\u91cf\u7d71\u8a08<\/h3>\n<p>\u5728\u7db2\u7ad9\u5206\u6790\u4e2d\uff0c\u4f30\u7b97\u7368\u7acb\u8a2a\u5ba2\u7684\u6578\u91cf\u662f\u4e00\u500b\u5e38\u898b\u9700\u6c42\u3002\u4f7f\u7528 HyperLogLog\uff0c\u53ef\u4ee5\u5feb\u901f\u800c\u6e96\u78ba\u5730\u8a08\u7b97\u51fa\u6bcf\u5929\u7684\u7368\u7acb\u8a2a\u5ba2\u6578\uff0c\u800c\u4e0d\u9700\u8981\u5b58\u5132\u6bcf\u500b\u8a2a\u5ba2\u7684\u8a73\u7d30\u4fe1\u606f\u3002<\/p>\n<h3 id=\"2-%e7%a4%be%e4%ba%a4%e5%aa%92%e9%ab%94%e5%88%86%e6%9e%90-HQcMhtLVLR\">2. \u793e\u4ea4\u5a92\u9ad4\u5206\u6790<\/h3>\n<p>\u5728\u793e\u4ea4\u5a92\u9ad4\u5e73\u53f0\u4e0a\uff0c\u4e86\u89e3\u7368\u7279\u7528\u6236\u7684\u4e92\u52d5\u60c5\u6cc1\u81f3\u95dc\u91cd\u8981\u3002HyperLogLog \u53ef\u4ee5\u7528\u4f86\u4f30\u7b97\u7279\u5b9a\u6642\u9593\u6bb5\u5167\u7684\u7368\u7279\u4e92\u52d5\u7528\u6236\u6578\uff0c\u5e6b\u52a9\u4f01\u696d\u5236\u5b9a\u66f4\u6709\u6548\u7684\u71df\u92b7\u7b56\u7565\u3002<\/p>\n<h3 id=\"3-%e6%95%b8%e6%93%9a%e5%8e%bb%e9%87%8d-HQcMhtLVLR\">3. \u6578\u64da\u53bb\u91cd<\/h3>\n<p>\u5728\u5927\u6578\u64da\u8655\u7406\u904e\u7a0b\u4e2d\uff0c\u53bb\u91cd\u662f\u4e00\u500b\u91cd\u8981\u7684\u6b65\u9a5f\u3002HyperLogLog \u53ef\u4ee5\u7528\u4f86\u5feb\u901f\u4f30\u7b97\u6578\u64da\u96c6\u4e2d\u552f\u4e00\u5143\u7d20\u7684\u6578\u91cf\uff0c\u5f9e\u800c\u5e6b\u52a9\u958b\u767c\u8005\u512a\u5316\u6578\u64da\u8655\u7406\u6d41\u7a0b\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-HQcMhtLVLR\">\u7d50\u8ad6<\/h2>\n<p>Redis HyperLogLog \u662f\u4e00\u7a2e\u9ad8\u6548\u7684\u6578\u64da\u7d50\u69cb\uff0c\u80fd\u5920\u4ee5\u6975\u5c0f\u7684\u5167\u5b58\u4f54\u7528\u4f86\u4f30\u7b97\u5927\u91cf\u6578\u64da\u4e2d\u7684\u552f\u4e00\u5143\u7d20\u6578\u91cf\u3002\u7121\u8ad6\u662f\u5728\u7db2\u7ad9\u8a2a\u554f\u91cf\u7d71\u8a08\u3001\u793e\u4ea4\u5a92\u9ad4\u5206\u6790\u9084\u662f\u6578\u64da\u53bb\u91cd\u7b49\u5834\u666f\u4e2d\uff0cHyperLogLog \u90fd\u80fd\u63d0\u4f9b\u5feb\u901f\u800c\u6e96\u78ba\u7684\u7d50\u679c\u3002\u5c0d\u65bc\u9700\u8981\u8655\u7406\u5927\u898f\u6a21\u6578\u64da\u7684\u4f01\u696d\u4f86\u8aaa\uff0c\u4e86\u89e3\u548c\u4f7f\u7528 HyperLogLog \u5c07\u662f\u63d0\u5347\u6578\u64da\u8655\u7406\u6548\u7387\u7684\u91cd\u8981\u4e00\u6b65\u3002<\/p>\n<p>\u5982\u679c\u60a8\u5c0d\u65bc\u5982\u4f55\u5728\u60a8\u7684\u696d\u52d9\u4e2d\u5be6\u65bd\u9019\u4e9b\u6280\u8853\u611f\u8208\u8da3\uff0c\u6216\u8005\u60f3\u8981\u4e86\u89e3\u66f4\u591a\u95dc\u65bc <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u53ca\u5176\u61c9\u7528\u7684\u8cc7\u8a0a\uff0c\u6b61\u8fce\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Redis HyperLogLog \u662f\u4e00\u7a2e\u9ad8\u6548\u7684\u57fa\u6578\u4f30\u7b97\u6280\u8853\uff0c\u9069\u7528\u65bc\u5927\u6578\u64da\u5834\u666f\uff0c\u5982\u7528\u6236\u8a08\u6578\u548c\u552f\u4e00\u8a2a\u554f\u8005\u5206\u6790\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-97226","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/97226","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=97226"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/97226\/revisions"}],"predecessor-version":[{"id":97227,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/97226\/revisions\/97227"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=97226"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=97226"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=97226"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}