{"id":387436,"date":"2024-06-29T07:18:55","date_gmt":"2024-06-29T07:18:55","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=387436"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-29T07:18:55","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=387436","title":{"rendered":"<span>\u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u044b\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0433\u0434\u0435 \u043e\u043d\u0438 \u043e\u0431\u0438\u0442\u0430\u044e\u0442<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0427\u0442\u043e \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0430\u043a\u043e\u0435?<\/h2>\n<p>\u041f\u043e\u0434\u00a0\u044d\u0442\u0438\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043c \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438\u00a0\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u00a0\u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u00ab\u0434\u0430\u00bb \u0438\u043b\u0438 \u00ab\u043d\u0435\u0442\u00bb, \u0430\u00a0\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00ab\u0442\u043e\u0447\u043d\u043e \u043d\u0435\u0442\u00bb \u0438 \u00ab\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u00bb. \u041a\u0430\u043a\u00a0\u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0432\u00a0\u0437\u0430\u0434\u0430\u0447\u0430\u0445, \u0433\u0434\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0441\u0434\u0435\u043b\u0430\u044e \u043e\u0431\u0437\u043e\u0440 \u0442\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a\u0443\u044e \u043f\u043e\u043b\u044c\u0437\u0443 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u043d\u0435\u0441\u0442\u0438 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435. \u041a \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u044b\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043d\u0435\u0441\u0442\u0438 \u0444\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430, HyperLogLog \u0438 Count-Min Sketch.<\/p>\n<h2>\u0424\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430<\/h2>\n<p><em>\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d:<\/em> \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043b\u0438 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043a \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0443. \u0424\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043e\u0431\u044a\u0451\u043c\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 \u0432 \u0432\u0438\u0434\u0435 \u00ab\u043d\u0435\u0442\u00bb\/\u00ab\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u00bb. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0444\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430 \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u0438\u0441\u043a\u0435 \u0441\u043b\u043e\u0432 \u0432 \u0442\u0435\u043a\u0441\u0442\u0435.<\/p>\n<p>\u0424\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0431\u0438\u0442\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 M \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 k \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 \u043e\u0442 0 \u0434\u043e M-1.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d1c\/4b5\/0d7\/d1c4b50d7215e044aa3b7ce435a90428.png\" width=\"809\" height=\"258\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d1c\/4b5\/0d7\/d1c4b50d7215e044aa3b7ce435a90428.png\"\/><\/figure>\n<p><strong>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e<\/strong> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443:<\/p>\n<ol>\n<li>\n<p>\u0414\u043b\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0425 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0432\u0441\u0435 k \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439 <\/p>\n<\/li>\n<li>\n<p>\u0411\u0435\u0440\u0451\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0435\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f h<sub>1<\/sub>, h<sub>2<\/sub>, \u2026, h<sub>k<\/sub> \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0431\u0438\u0442\u044b \u0441 \u044d\u0442\u0438\u043c\u0438 \u043d\u043e\u043c\u0435\u0440\u0430\u043c\u0438 \u0432 1<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c15\/50e\/f05\/c1550ef05416abdc144c0fd0a64ce4ef.png\" alt=\"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e (\u0438\u0437\u043c\u0435\u043d\u0438\u0432\u0448\u0438\u0435\u0441\u044f \u0431\u0438\u0442\u044b \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u043a\u0440\u0430\u0441\u043d\u044b\u043c)\" title=\"\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e (\u0438\u0437\u043c\u0435\u043d\u0438\u0432\u0448\u0438\u0435\u0441\u044f \u0431\u0438\u0442\u044b \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u043a\u0440\u0430\u0441\u043d\u044b\u043c)\" width=\"1600\" height=\"809\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c15\/50e\/f05\/c1550ef05416abdc144c0fd0a64ce4ef.png\"\/><\/p>\n<div><figcaption>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e (\u0438\u0437\u043c\u0435\u043d\u0438\u0432\u0448\u0438\u0435\u0441\u044f \u0431\u0438\u0442\u044b \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u043a\u0440\u0430\u0441\u043d\u044b\u043c)<\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0444\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <strong>\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u0432\u0445\u043e\u0434\u0438\u0442 \u043b\u0438 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e<\/strong>: \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0445\u044d\u0448-\u0441\u0443\u043c\u043c\u044b \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0431\u0438\u0442\u044b \u0440\u0430\u0432\u043d\u044b 1. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0439 \u0438\u043b\u0438 \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0440\u0430\u0432\u043d\u044b 1 (\u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0442\u043e\u0438\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0441\u0441\u0438\u0432\u0430).<\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438, \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438 \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0411\u043b\u0443\u043c\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\n<p>Apache HBase \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0411\u043b\u0443\u043c\u0430 \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043f\u043e \u043a\u043b\u044e\u0447\u0443.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/CloudFlare%20%D0%B8%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D1%83%D0%B5%D1%82%20%D0%B8%D1%85%20%D0%B4%D0%BB%D1%8F%20%D0%B0%D0%BD%D0%B0%D0%BB%D0%B8%D0%B7%D0%B0%20%D1%81%D0%BF%D1%83%D1%84%D0%B8%D0%BD%D0%B3%D0%B0%20IP-%D0%B0%D0%B4%D1%80%D0%B5%D1%81%D0%BE%D0%B2\" rel=\"noopener noreferrer nofollow\">CloudFlare \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0438\u0445 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0441\u043f\u0443\u0444\u0438\u043d\u0433\u0430 IP-\u0430\u0434\u0440\u0435\u0441\u043e\u0432<\/a>.<\/p>\n<\/li>\n<li>\n<p>\u0412 PostgreSQL \u0444\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <a href=\"https:\/\/www.postgresql.org\/docs\/current\/bloom.html\" rel=\"noopener noreferrer nofollow\">bloom<\/a>.<\/p>\n<\/li>\n<\/ul>\n<h2>HyperLogLog<\/h2>\n<p><em>\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d:<\/em> \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043d\u0430\u0431\u043e\u0440\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0446\u0435\u043d\u043a\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0432 10<sup>9<\/sup> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 ~1.5 \u041a\u0411 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u043e\u043a\u043e\u043b\u043e 2%.<\/p>\n<p>HyperLogLog \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u0434\u0432\u0443\u0445 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0430\u043a\u0442\u0430\u0445:<\/p>\n<ol>\n<li>\n<p>\u0423 \u00ab\u0445\u043e\u0440\u043e\u0448\u0438\u0445\u00bb \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 32 \u0438\u043b\u0438 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b) \u0441\u0443\u0444\u0444\u0438\u043a\u0441 \u0438\u0437 \u043d\u0443\u043b\u0435\u0439 \u0434\u043b\u0438\u043d\u044b k \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0440\u0430\u0437 \u0432 2<sup>k<\/sup> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432: \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u043d\u043e\u043b\u044c \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0440\u0430\u0432\u043d\u0430 \u00bd, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c k \u043d\u0443\u043b\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u0430 (\u00bd)<sup>k<\/sup>.<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b6e\/f0c\/a35\/b6ef0ca35117d99c0bd65685c05d9fb1.png\" width=\"771\" height=\"328\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b6e\/f0c\/a35\/b6ef0ca35117d99c0bd65685c05d9fb1.png\"\/><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u044d\u0441\u0442\u0438\u043c\u0430\u0442\u043e\u0440: \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0445\u044d\u0448 \u0438 \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043c \u0434\u043b\u0438\u043d\u0443 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0441\u0443\u0444\u0444\u0438\u043a\u0441\u0430 k. \u0422\u043e\u0433\u0434\u0430 \u0432 \u043d\u0430\u0448\u0435\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 2<sup>k<\/sup> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>\u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0442\u0430\u043a\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430 \u043d\u0430\u043c \u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u2013 \u043c\u0435\u0436\u0434\u0443 2<sup>30<\/sup> \u0438 2<sup>31<\/sup> \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430, \u0434\u0430 \u0438 \u0437\u0430\u043a\u043e\u043d \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0447\u0438\u0441\u0435\u043b \u043d\u0430\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0436\u0434\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u043b\u0433\u043e, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u0441\u0443\u0444\u0444\u0438\u043a\u0441 \u043b\u044e\u0431\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430.<\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u0443\u044e \u043e\u0446\u0435\u043d\u043a\u0443, \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c m \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0437\u0430\u0442\u0435\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0434\u043b\u0438\u043d\u044b \u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0441\u0443\u0444\u0444\u0438\u043a\u0441\u043e\u0432 R<sub>1<\/sub>,R<sub>2<\/sub>,&#8230;,R<sub>N<\/sub> \u0438 \u0443\u0441\u0440\u0435\u0434\u043d\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b3e\/c2b\/71f\/b3ec2b71f0954ecfc76632966a99a7c3.png\" width=\"389\" height=\"53\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b3e\/c2b\/71f\/b3ec2b71f0954ecfc76632966a99a7c3.png\"\/><\/figure>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0434\u043e\u0440\u043e\u0433\u043e \u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u043c\u043d\u043e\u0433\u043e, \u0442\u043e \u0432 LogLog (\u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u0431\u0435\u0437 Hyper) \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0442\u0440\u044e\u043a: \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0442\u043a\u0443\u0441\u0438\u043c \u043f\u0435\u0440\u0432\u044b\u0435 M \u0431\u0438\u0442 \u0443 \u0445\u044d\u0448\u0430 \u0438 \u043d\u0430\u0437\u043e\u0432\u0451\u043c \u0438\u0445 \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u043d\u0430\u0448\u0435\u0439 \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u043e\u0441\u0442\u0430\u0432\u0448\u0430\u044f\u0441\u044f \u0447\u0430\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0445\u044d\u0448\u0435\u043c. \u0422\u043e\u0433\u0434\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0441\u0435\u0433\u043e 1 \u0445\u044d\u0448, \u0430 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f.<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0448\u0430\u0433\u0430 \u0430\u0432\u0442\u043e\u0440\u044b HyperLogLog \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u0430\u0440\u043c\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u043f\u043e\u043f\u0440\u0430\u0432\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c: <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/adc\/287\/ede\/adc287ede096c26fbedda06c294fc335.png\" width=\"290\" height=\"83\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/adc\/287\/ede\/adc287ede096c26fbedda06c294fc335.png\"\/><\/figure>\n<p>\u0413\u0434\u0435 HyperLogLog \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438:<\/p>\n<ul>\n<li>\n<p>Presto \u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u0432\u0438\u0436\u043a\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0451\u043c\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 <a href=\"https:\/\/prestodb.io\/docs\/current\/functions\/hyperloglog.html\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 HyperLogLog<\/a> \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0447\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 COUNT(DISTINCT)<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/redis.io\/docs\/data-types\/hyperloglogs\/\" rel=\"noopener noreferrer nofollow\">\u043c\u043e\u0434\u0443\u043b\u044c HyperLogLog \u0435\u0441\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 Redis<\/a><\/p>\n<\/li>\n<\/ul>\n<h2>Count-Min Sketch<\/h2>\n<p><em>\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d:<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043f\u043e\u0442\u043e\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u0442\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e\u043c \u0432\u0438\u0434\u0435, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u0435\u043c\u0443 \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e \u0447\u0430\u0441\u0442\u043e\u0442\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. Count-Min Sketch \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u0445: \u043e\u0442 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430.<\/p>\n<p>\u041a\u0430\u043a \u0438 \u0434\u0432\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, Count-Min Sketch \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e (D) \u0445\u044d\u0448 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u0430\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u043e\u0432 \u0434\u043b\u0438\u043d\u044b W:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/ff4\/dfd\/a9b\/ff4dfda9b2e0e5cfb5943ec3ffb0678a.png\" width=\"872\" height=\"548\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ff4\/dfd\/a9b\/ff4dfda9b2e0e5cfb5943ec3ffb0678a.png\"\/><\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f D \u0445\u044d\u0448\u0435\u0439 h<sub>1<\/sub>,h<sub>2<\/sub>,&#8230;,h<sub>D<\/sub>, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u044f\u043c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u0445, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 1.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a2d\/68f\/2b2\/a2d68f2b2fd0e27310caacbded005b9f.png\" width=\"720\" height=\"357\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a2d\/68f\/2b2\/a2d68f2b2fd0e27310caacbded005b9f.png\"\/><\/figure>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u2013 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f D \u0445\u044d\u0448\u0435\u0439, \u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a min(f<sub>1<\/sub>, \u2026, f<sub>D<\/sub>), \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0439.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f Count-Min Sketch \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u0445\u0440\u0430\u043d\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p>\u0413\u0434\u0435 \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435:<\/p>\n<ul>\n<li>\n<p>\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043f\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0443 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430, \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0441\u043b\u043e\u0432 \u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0439;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/redis.com\/blog\/count-min-sketch-the-art-and-science-of-estimating-stuff\/\" rel=\"noopener noreferrer nofollow\"><u>\u0432 Redis<\/u><\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/743800\/\"> https:\/\/habr.com\/ru\/articles\/743800\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0427\u0442\u043e \u044d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0430\u043a\u043e\u0435?<\/h2>\n<p>\u041f\u043e\u0434\u00a0\u044d\u0442\u0438\u043c \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043c \u043f\u043e\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043b\u0438\u00a0\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u00a0\u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u00ab\u0434\u0430\u00bb \u0438\u043b\u0438 \u00ab\u043d\u0435\u0442\u00bb, \u0430\u00a0\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u044b\u0435 \u043e\u0442\u0432\u0435\u0442\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00ab\u0442\u043e\u0447\u043d\u043e \u043d\u0435\u0442\u00bb \u0438 \u00ab\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u00bb. \u041a\u0430\u043a\u00a0\u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0432\u00a0\u0437\u0430\u0434\u0430\u0447\u0430\u0445, \u0433\u0434\u0435 \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0441\u0434\u0435\u043b\u0430\u044e \u043e\u0431\u0437\u043e\u0440 \u0442\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a\u0443\u044e \u043f\u043e\u043b\u044c\u0437\u0443 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u043d\u0435\u0441\u0442\u0438 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435. \u041a \u0431\u0430\u0437\u043e\u0432\u044b\u043c \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u044b\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043d\u0435\u0441\u0442\u0438 \u0444\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430, HyperLogLog \u0438 Count-Min Sketch.<\/p>\n<h2>\u0424\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430<\/h2>\n<p><em>\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d:<\/em> \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u043b\u0438 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043a \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0443. \u0424\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043e\u0431\u044a\u0451\u043c\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0442\u0432\u0435\u0442 \u0432 \u0432\u0438\u0434\u0435 \u00ab\u043d\u0435\u0442\u00bb\/\u00ab\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u00bb. \u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0444\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430 \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u0438\u0441\u043a\u0435 \u0441\u043b\u043e\u0432 \u0432 \u0442\u0435\u043a\u0441\u0442\u0435.<\/p>\n<p>\u0424\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0431\u0438\u0442\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 M \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 k \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 \u043e\u0442 0 \u0434\u043e M-1.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p><strong>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e<\/strong> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443:<\/p>\n<ol>\n<li>\n<p>\u0414\u043b\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0425 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0432\u0441\u0435 k \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439 <\/p>\n<\/li>\n<li>\n<p>\u0411\u0435\u0440\u0451\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0438\u0435\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f h<sub>1<\/sub>, h<sub>2<\/sub>, \u2026, h<sub>k<\/sub> \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0431\u0438\u0442\u044b \u0441 \u044d\u0442\u0438\u043c\u0438 \u043d\u043e\u043c\u0435\u0440\u0430\u043c\u0438 \u0432 1<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\">\n<div><figcaption>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e (\u0438\u0437\u043c\u0435\u043d\u0438\u0432\u0448\u0438\u0435\u0441\u044f \u0431\u0438\u0442\u044b \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u043a\u0440\u0430\u0441\u043d\u044b\u043c)<\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0444\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <strong>\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430, \u0432\u0445\u043e\u0434\u0438\u0442 \u043b\u0438 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e<\/strong>: \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0445\u044d\u0448-\u0441\u0443\u043c\u043c\u044b \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0431\u0438\u0442\u044b \u0440\u0430\u0432\u043d\u044b 1. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0439 \u0438\u043b\u0438 \u043a\u043e\u0433\u0434\u0430 \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0440\u0430\u0432\u043d\u044b 1 (\u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0442\u043e\u0438\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0441\u0441\u0438\u0432\u0430).<\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438, \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u0438 \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0411\u043b\u0443\u043c\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\n<p>Apache HBase \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0411\u043b\u0443\u043c\u0430 \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043f\u043e \u043a\u043b\u044e\u0447\u0443.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/CloudFlare%20%D0%B8%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D1%83%D0%B5%D1%82%20%D0%B8%D1%85%20%D0%B4%D0%BB%D1%8F%20%D0%B0%D0%BD%D0%B0%D0%BB%D0%B8%D0%B7%D0%B0%20%D1%81%D0%BF%D1%83%D1%84%D0%B8%D0%BD%D0%B3%D0%B0%20IP-%D0%B0%D0%B4%D1%80%D0%B5%D1%81%D0%BE%D0%B2\" rel=\"noopener noreferrer nofollow\">CloudFlare \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0438\u0445 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0441\u043f\u0443\u0444\u0438\u043d\u0433\u0430 IP-\u0430\u0434\u0440\u0435\u0441\u043e\u0432<\/a>.<\/p>\n<\/li>\n<li>\n<p>\u0412 PostgreSQL \u0444\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <a href=\"https:\/\/www.postgresql.org\/docs\/current\/bloom.html\" rel=\"noopener noreferrer nofollow\">bloom<\/a>.<\/p>\n<\/li>\n<\/ul>\n<h2>HyperLogLog<\/h2>\n<p><em>\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d:<\/em> \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043d\u0430\u0431\u043e\u0440\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0446\u0435\u043d\u043a\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u0432 10<sup>9<\/sup> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 ~1.5 \u041a\u0411 \u043f\u0430\u043c\u044f\u0442\u0438 \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u044c \u043e\u043a\u043e\u043b\u043e 2%.<\/p>\n<p>HyperLogLog \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u0434\u0432\u0443\u0445 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0430\u043a\u0442\u0430\u0445:<\/p>\n<ol>\n<li>\n<p>\u0423 \u00ab\u0445\u043e\u0440\u043e\u0448\u0438\u0445\u00bb \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0440\u0430\u0432\u043d\u043e\u043c\u0435\u0440\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u043c \u043f\u043e\u0442\u043e\u043a\u0435 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 32 \u0438\u043b\u0438 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b) \u0441\u0443\u0444\u0444\u0438\u043a\u0441 \u0438\u0437 \u043d\u0443\u043b\u0435\u0439 \u0434\u043b\u0438\u043d\u044b k \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u0440\u0430\u0437 \u0432 2<sup>k<\/sup> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432: \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u043d\u043e\u043b\u044c \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0440\u0430\u0432\u043d\u0430 \u00bd, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c k \u043d\u0443\u043b\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u0430 (\u00bd)<sup>k<\/sup>.<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u044d\u0441\u0442\u0438\u043c\u0430\u0442\u043e\u0440: \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0445\u044d\u0448 \u0438 \u0437\u0430\u043f\u043e\u043c\u043d\u0438\u043c \u0434\u043b\u0438\u043d\u0443 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0441\u0443\u0444\u0444\u0438\u043a\u0441\u0430 k. \u0422\u043e\u0433\u0434\u0430 \u0432 \u043d\u0430\u0448\u0435\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 2<sup>k<\/sup> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>\u0412 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0442\u0430\u043a\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430 \u043d\u0430\u043c \u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u2013 \u043c\u0435\u0436\u0434\u0443 2<sup>30<\/sup> \u0438 2<sup>31<\/sup> \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0440\u0430\u0437\u043d\u0438\u0446\u0430, \u0434\u0430 \u0438 \u0437\u0430\u043a\u043e\u043d \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0447\u0438\u0441\u0435\u043b \u043d\u0430\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0436\u0434\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u043b\u0433\u043e, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u0441\u0443\u0444\u0444\u0438\u043a\u0441 \u043b\u044e\u0431\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430.<\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u0443\u044e \u043e\u0446\u0435\u043d\u043a\u0443, \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c m \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0437\u0430\u0442\u0435\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0434\u043b\u0438\u043d\u044b \u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0441\u0443\u0444\u0444\u0438\u043a\u0441\u043e\u0432 R<sub>1<\/sub>,R<sub>2<\/sub>,&#8230;,R<sub>N<\/sub> \u0438 \u0443\u0441\u0440\u0435\u0434\u043d\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: <\/p>\n<figure class=\"\"><\/figure>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0434\u043e\u0440\u043e\u0433\u043e \u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435 \u043c\u043d\u043e\u0433\u043e, \u0442\u043e \u0432 LogLog (\u043f\u043e\u043a\u0430 \u0447\u0442\u043e \u0431\u0435\u0437 Hyper) \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0442\u0440\u044e\u043a: \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0442\u043a\u0443\u0441\u0438\u043c \u043f\u0435\u0440\u0432\u044b\u0435 M \u0431\u0438\u0442 \u0443 \u0445\u044d\u0448\u0430 \u0438 \u043d\u0430\u0437\u043e\u0432\u0451\u043c \u0438\u0445 \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u043d\u0430\u0448\u0435\u0439 \u0445\u044d\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u043e\u0441\u0442\u0430\u0432\u0448\u0430\u044f\u0441\u044f \u0447\u0430\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0445\u044d\u0448\u0435\u043c. \u0422\u043e\u0433\u0434\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0441\u0435\u0433\u043e 1 \u0445\u044d\u0448, \u0430 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f.<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0448\u0430\u0433\u0430 \u0430\u0432\u0442\u043e\u0440\u044b HyperLogLog \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u0430\u0440\u043c\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c \u0434\u043b\u044f \u043f\u043e\u043f\u0440\u0430\u0432\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c: <\/p>\n<figure class=\"\"><\/figure>\n<p>\u0413\u0434\u0435 HyperLogLog \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0442\u0438\u0442\u044c \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0436\u0438\u0437\u043d\u0438:<\/p>\n<ul>\n<li>\n<p>Presto \u0438 \u043c\u043d\u043e\u0433\u0438\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u0432\u0438\u0436\u043a\u0438 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0451\u043c\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 <a href=\"https:\/\/prestodb.io\/docs\/current\/functions\/hyperloglog.html\" rel=\"noopener noreferrer nofollow\">\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 HyperLogLog<\/a> \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0447\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043c\u0435\u043d\u044c\u0448\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 COUNT(DISTINCT)<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/redis.io\/docs\/data-types\/hyperloglogs\/\" rel=\"noopener noreferrer nofollow\">\u043c\u043e\u0434\u0443\u043b\u044c HyperLogLog \u0435\u0441\u0442\u044c \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 Redis<\/a><\/p>\n<\/li>\n<\/ul>\n<h2>Count-Min Sketch<\/h2>\n<p><em>\u0417\u0430\u0447\u0435\u043c \u043d\u0443\u0436\u0435\u043d:<\/em> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043f\u043e\u0442\u043e\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u0442\u043e\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e\u043c \u0432\u0438\u0434\u0435, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u0435\u043c\u0443 \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e \u0447\u0430\u0441\u0442\u043e\u0442\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. Count-Min Sketch \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442\u0441\u044f \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u044f\u0445: \u043e\u0442 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430.<\/p>\n<p>\u041a\u0430\u043a \u0438 \u0434\u0432\u0435 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, Count-Min Sketch \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e (D) \u0445\u044d\u0448 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u0430\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u043e\u0432 \u0434\u043b\u0438\u043d\u044b W:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0417\u0430\u0442\u0435\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f D \u0445\u044d\u0448\u0435\u0439 h<sub>1<\/sub>,h<sub>2<\/sub>,&#8230;,h<sub>D<\/sub>, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u0437\u0438\u0446\u0438\u044f\u043c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u0445, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043d\u0430 1.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0435 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u2013 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f D \u0445\u044d\u0448\u0435\u0439, \u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a min(f<sub>1<\/sub>, \u2026, f<sub>D<\/sub>), \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043a\u043e\u043b\u043b\u0438\u0437\u0438\u0439.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f Count-Min Sketch \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u0445\u0440\u0430\u043d\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430.<\/p>\n<p>\u0413\u0434\u0435 \u044d\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435:<\/p>\n<ul>\n<li>\n<p>\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 \u043f\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0443 \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430, \u0447\u0430\u0441\u0442\u043e\u0442\u043d\u043e\u0441\u0442\u0438 \u0441\u043b\u043e\u0432 \u0438\u043b\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0439;<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/redis.com\/blog\/count-min-sketch-the-art-and-science-of-estimating-stuff\/\" rel=\"noopener noreferrer nofollow\"><u>\u0432 Redis<\/u><\/a><\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/743800\/\"> https:\/\/habr.com\/ru\/articles\/743800\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-387436","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/387436","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=387436"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/387436\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=387436"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=387436"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=387436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}