{"id":314462,"date":"2020-12-07T15:01:29","date_gmt":"2020-12-07T15:01:29","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=314462"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=314462","title":{"rendered":"\u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c \u0442\u0430\u0431\u043b\u0438\u0446 ClickHouse \u0434\u043b\u044f PlantUML"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u044b \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445, \u0440\u0430\u0437\u043d\u044b\u0435 DBMS \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u0432\u043e\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. \u0418 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u043d\u0438\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 <code>DESC table_name<\/code>, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 ClickHouse. \u041e\u0434\u043d\u0430\u043a\u043e, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u044d\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0435 \u0441\u0442\u043e\u043b\u044c \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u0435\u043d, \u043a\u0430\u043a \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">DESCRIBE TABLE data_lr  name        type      default_type   default_expression   comment   codec_expression   ttl_expression Path        String                                                  ZSTD(3) Value       Float64                                                 Gorilla, LZ4 Time        UInt32                                                  DoubleDelta, LZ4 Date        Date                                                    DoubleDelta, LZ4 Timestamp   UInt32                                                  DoubleDelta, LZ4<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b <code>tables<\/code> \u0438 <code>columns<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0438\u0441\u0447\u0435\u0440\u043f\u044b\u0432\u0430\u044e\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u043c\u043f\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/0y\/ll\/zy\/0yllzyq6jf6ybnolejtqmriduww.png\"><\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"vdohnovenie\">\u0412\u0434\u043e\u0445\u043d\u043e\u0432\u0435\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u0442\u044c \u0437\u0430\u0431\u043e\u0442\u043b\u0438\u0432\u043e \u043f\u0438\u043b\u0438\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043b\u0438\u0448\u0451\u043d\u043d\u043e\u0435 \u0444\u0430\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432, \u044f \u043f\u043e\u0438\u0441\u043a\u0430\u043b \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b. \u0418 \u0432\u043e\u0442 \u044d\u0442\u0430 <a href=\"https:\/\/www.red-gate.com\/simple-talk\/sql\/sql-tools\/automatically-creating-uml-database-diagrams-for-sql-server\/\" rel=\"nofollow\">\u0440\u0430\u0431\u043e\u0442\u0430<\/a> \u0432\u0434\u043e\u0445\u043d\u043e\u0432\u0438\u043b\u0430 \u043c\u0435\u043d\u044f \u043d\u0430\u0447\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0441 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u044b \u043e\u0442\u0442\u0443\u0434\u0430, \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0441\u0442\u0432\u0430.<\/p>\n<p>  <\/p>\n<h2 id=\"chto-takoe-plantuml\">\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 PlantUML<\/h2>\n<p>  <\/p>\n<p>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0432 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0434\u0443\u043a\u0442. \u0414\u043b\u044f \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0437\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/plantuml.com\/\" rel=\"nofollow\">\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443<\/a>. \u0415\u0441\u043b\u0438 \u0432 \u0434\u0432\u0443\u0445 \u0441\u043b\u043e\u0432\u0430\u0445, \u0442\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">@startuml Bob -&gt; Alice : hello @enduml<\/code><\/pre>\n<p>  <\/p>\n<p>\u0432 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hj\/aa\/3e\/hjaa3ebwrejbneohh7b0l9vk6gc.png\"><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u0438\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/plantuml.com\/use-case-diagram\" rel=\"nofollow\">\u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u044b \u043f\u0440\u0435\u0446\u0435\u0434\u0435\u043d\u0442\u043e\u0432<\/a>, <a href=\"https:\/\/plantuml.com\/class-diagram\" rel=\"nofollow\">\u043a\u043b\u0430\u0441\u0441\u043e\u0432<\/a>, <a href=\"https:\/\/plantuml.com\/class-diagram\" rel=\"nofollow\">\u0434\u0435\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/a>, <a href=\"https:\/\/plantuml.com\/component-diagram\" rel=\"nofollow\">\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432<\/a> \u0438 \u0434\u0440\u0443\u0433\u0438\u0435. \u0418\u043c\u0435\u0435\u0442\u0441\u044f <a href=\"https:\/\/avono-support.atlassian.net\/wiki\/spaces\/PUML\/overview\" rel=\"nofollow\">\u043f\u043b\u0430\u0433\u0438\u043d<\/a> \u0434\u043b\u044f Atlassian Confluence, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441 \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u044f\u043c\u043e \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\u0445 wiki. <a href=\"https:\/\/github.com\/timofurrer\/pandoc-plantuml-filter\" rel=\"nofollow\">\u041f\u043b\u0430\u0433\u0438\u043d<\/a> \u0434\u043b\u044f pandoc (\u0438 <a href=\"https:\/\/github.com\/kbonne\/pandoc-plantuml-filter\" rel=\"nofollow\">\u043d\u0435 \u043e\u0434\u0438\u043d<\/a>), \u0434\u043b\u044f <a href=\"https:\/\/ctan.org\/pkg\/plantuml\" rel=\"nofollow\">LaTeX<\/a>, \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.<\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0434\u0430\u0436\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u044f\u043c\u043e \u043d\u0430 <a href=\"http:\/\/www.plantuml.com\/plantuml\/uml\/SyfFKj2rKt3CoKnELR1Io4ZDoSa70000\" rel=\"nofollow\">\u0441\u0430\u0439\u0442\u0435<\/a>.<\/p>\n<p>  <\/p>\n<h2 id=\"ideya\">\u0418\u0434\u0435\u044f<\/h2>\n<p>  <\/p>\n<p>\u0418\u0434\u0435\u044f \u043f\u0440\u043e\u0441\u0442\u0430: \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 <a href=\"https:\/\/clickhouse.tech\/docs\/en\/operations\/system-tables\/tables\/\" rel=\"nofollow\">system.tables<\/a> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043e\u0431\u0449\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445, \u0434\u0432\u0438\u0436\u043a\u0430\u0445, \u043a\u043b\u044e\u0447\u0430\u0445 \u043f\u0430\u0440\u0442\u0438\u0446\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0438 \u0441\u044d\u043c\u043f\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0438 \u0434\u0440. \u0410 \u0432 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435, <a href=\"https:\/\/clickhouse.tech\/docs\/en\/operations\/system-tables\/columns\/\" rel=\"nofollow\">system.columns<\/a>, \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043a\u043e\u043b\u043e\u043d\u043e\u043a. \u041a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u0443\u044f \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435, \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0447\u0430\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u043a\u043e\u043b\u043e\u043d\u043a\u0430\u043c \u0438 \u043a\u043b\u044e\u0447\u0430\u043c \u0442\u0430\u0431\u043b\u0438\u0446. \u042d\u0442\u043e \u0432\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446 \u043d\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0435.<\/p>\n<p>  <\/p>\n<h2 id=\"realizaciya\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h2>\n<p>  <\/p>\n<p>\u041f\u0440\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u043a\u043e\u043b\u043e\u043d\u043a\u0430\u043c\u0438 \u044f\u0441\u043d\u043e, \u043d\u043e \u0435\u0441\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u0430 \u0447\u0430\u0441\u0442\u044c, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f \u0443\u0434\u0435\u043b\u0438\u043b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u0434\u0432\u0438\u0436\u043a\u043e\u0432 \u0442\u0430\u0431\u043b\u0438\u0446 \u0438\u043c\u0435\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0441\u043f\u0430\u0440\u0441\u0438\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/clickhouse.tech\/docs\/en\/engines\/table-engines\/mergetree-family\/replacingmergetree\/\" rel=\"nofollow\">ReplacingMergeTree<\/a> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 Version. \u0418 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0432\u0438\u0436\u043a\u043e\u043c. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <a href=\"https:\/\/clickhouse.tech\/docs\/en\/engines\/table-engines\/mergetree-family\/replication\/#creating-replicated-tables\" rel=\"nofollow\">Replicated*MergeTree<\/a>. \u0422\u0430\u043a\u0436\u0435 \u0434\u043b\u044f <a href=\"https:\/\/clickhouse.tech\/docs\/en\/sql-reference\/statements\/create\/view\/#materialized\" rel=\"nofollow\">MaterializedView<\/a> \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u042d\u0442\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u0438 \u043e\u043d\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0430 \u0434\u043b\u044f MV.<\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0431\u044b\u043b\u043e \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u0447\u0430\u0441\u0442\u0435\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0442\u043e\u043a\u0435\u043d\u0430\u043c\u0438 \u0438 \u043f\u0430\u0440\u0441\u0438\u043d\u0433\u043e\u043c \u0442\u0435\u043a\u0441\u0442\u0430, \u0445\u043e\u0442\u044f \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u0434\u0432\u0438\u0436\u043a\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u00b1 \u043b\u0435\u0433\u043a\u043e. \u0410 \u0443\u0436\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043d\u0438\u0445 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0430\u0440\u044b \u043a\u043b\u044e\u0447-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0418 \u044d\u0442\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446 \u043d\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0435.<\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/clickhouse.tech\/docs\/en\/engines\/table-engines\/special\/distributed\/\" rel=\"nofollow\">Distributed<\/a> \u0432\u0441\u0435\u0433\u0434\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0430 <a href=\"https:\/\/clickhouse.tech\/docs\/en\/engines\/table-engines\/special\/buffer\/\" rel=\"nofollow\">Buffer<\/a> \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434 <code>*MergeTree<\/code> \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043c\u0435\u043b\u043a\u0438\u0435 \u0432\u0441\u0442\u0430\u0432\u043a\u0438. \u0418 \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0442\u0430\u0431\u043b\u0438\u0446 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f. \u041d\u0430 \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0435 \u043e\u043d\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043a\u0430\u043c\u0438.<\/p>\n<p>  <\/p>\n<h2 id=\"rezultat\">\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h2>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c\u0430 \u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">@startuml ' This diagram is generated with https:\/\/github.com\/Felixoid\/clickhouse-plantuml !define Table(x) class x &lt;&lt; (T,mistyrose) &gt;&gt; !define View(x) class x &lt;&lt; (V,lightblue) &gt;&gt; !define MaterializedView(x) class x &lt;&lt; (m,orange) &gt;&gt; !define Distributed(x) class x &lt;&lt; (D,violet) &gt;&gt;  hide empty methods hide stereotypes skinparam classarrowcolor gray  Distributed(graphite.data) {   ENGINE=**Distributed**   ..engine config..   cluster: graphite_data   database: graphite   table: data_lr   sharding_key: cityHash64(Path)   ==columns==   Path: String   Value: Float64   Time: UInt32   Date: Date   Timestamp: UInt32 }  Table(graphite.data_lr) {   ENGINE=**ReplicatedGraphiteMergeTree**   ..engine config..   rollup_config: graphite_rollup   ..replication..   zoo_path: \/clickhouse\/tables\/graphite.data_lr\/{shard}   replica: {replica}   ==columns==   Path: String &lt;size:15&gt;&lt;&amp;signal&gt;&lt;\/size&gt;   Value: Float64   Time: UInt32 &lt;size:15&gt;&lt;&amp;signal&gt;&lt;\/size&gt;   Date: Date &lt;size:15&gt;&lt;&amp;list-rich&gt;&lt;\/size&gt;   Timestamp: UInt32   ..&lt;size:15&gt;&lt;&amp;list-rich&gt;&lt;\/size&gt;partition key..   toYYYYMMDD(toStartOfInterval(Date, toIntervalDay(3)))   ..&lt;size:15&gt;&lt;&amp;signal&gt;&lt;\/size&gt;sorting key..   Path, Time }  Table(graphite.index) {   ENGINE=**ReplicatedReplacingMergeTree**   ..engine config..   version: Version   ..replication..   zoo_path: \/clickhouse\/tables\/graphite.index\/1   replica: {replica}   ==columns==   Date: Date &lt;size:15&gt;&lt;&amp;list-rich&gt;&lt;\/size&gt; &lt;size:15&gt;&lt;&amp;signal&gt;&lt;\/size&gt;   Level: UInt32 &lt;size:15&gt;&lt;&amp;signal&gt;&lt;\/size&gt;   Path: String &lt;size:15&gt;&lt;&amp;signal&gt;&lt;\/size&gt;   Version: UInt32   ..&lt;size:15&gt;&lt;&amp;list-rich&gt;&lt;\/size&gt;partition key..   toYYYYMM(Date)   ..&lt;size:15&gt;&lt;&amp;signal&gt;&lt;\/size&gt;sorting key..   Level, Path, Date }  Table(graphite.tagged) {   ENGINE=**ReplicatedReplacingMergeTree**   ..engine config..   version: Version   ..replication..   zoo_path: \/clickhouse\/tables\/graphite.tagged\/1   replica: {replica}   ==columns==   Date: Date &lt;size:15&gt;&lt;&amp;list-rich&gt;&lt;\/size&gt; &lt;size:15&gt;&lt;&amp;signal&gt;&lt;\/size&gt;   Tag1: String &lt;size:15&gt;&lt;&amp;signal&gt;&lt;\/size&gt;   Path: String &lt;size:15&gt;&lt;&amp;signal&gt;&lt;\/size&gt;   Tags: Array(String)   Version: UInt32   ..&lt;size:15&gt;&lt;&amp;list-rich&gt;&lt;\/size&gt;partition key..   toYYYYMM(Date)   ..&lt;size:15&gt;&lt;&amp;signal&gt;&lt;\/size&gt;sorting key..   Tag1, Path, Date }  graphite.data_lr -|&gt; graphite.data @enduml<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/0y\/ll\/zy\/0yllzyq6jf6ybnolejtqmriduww.png\"><\/p>\n<\/div><\/div>\n<p>  <\/p>\n<h2 id=\"blizhayshie-plany\">\u0411\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0435 \u043f\u043b\u0430\u043d\u044b<\/h2>\n<p>  <\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u0441\u0442\u044b, \u0432 \u0438\u0434\u0435\u0430\u043b\u0435 \u2014 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 ClickHouse. \u0410 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0434\u0438\u0430\u0433\u0440\u0430\u043c\u043c \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u0432 ClickHouse. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u0442\u043e-\u0442\u043e \u043d\u0430\u0439\u0434\u0451\u0442 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u043a\u0435\u0439\u0441\u044b \u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 issue. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0435\u043a\u043e\u0432 \u0441\u0436\u0430\u0442\u0438\u044f, \u0445\u043e\u0442\u044f \u0434\u043b\u044f \u043c\u0435\u043d\u044f \u043e\u043d\u0438 \u043f\u043e\u043a\u0430 \u043d\u0435 \u0432\u0430\u0436\u043d\u044b.<\/p>\n<p>  <\/p>\n<h1 id=\"vmesto-zaklyucheniya\">\u0412\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/h1>\n<p>  <\/p>\n<p>\u042f \u0431\u0443\u0434\u0443 \u0440\u0430\u0434, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e\u0442 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043a\u043e\u043c\u0443-\u0442\u043e \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u0430\u0447\u0430\u0432 \u043c\u043e\u0434\u0443\u043b\u044c \u0438\u0437 pypi:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">pip install clickhouse-plantuml clickhouse-plantuml -h<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <a href=\"http:\/\/github.com\/Felixoid\/clickhouse-plantuml\" rel=\"nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  <\/p>\n<h4 id=\"spasibo-chto-potratili-vremya-na-prochtenie\">\u0421\u043f\u0430\u0441\u0438\u0431\u043e, \u0447\u0442\u043e \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b\u0438 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435!<\/h4>\n<\/div>\n<p> \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\/post\/531696\/\"> https:\/\/habr.com\/ru\/post\/531696\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u044b \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445, \u0440\u0430\u0437\u043d\u044b\u0435 DBMS \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u0432\u043e\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447. \u0418 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0438\u0437 \u043d\u0438\u0445 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 <code>DESC table_name<\/code>, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 ClickHouse. \u041e\u0434\u043d\u0430\u043a\u043e, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u044d\u0442\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0435 \u0441\u0442\u043e\u043b\u044c \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u0435\u043d, \u043a\u0430\u043a \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b.<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">DESCRIBE TABLE data_lr  name        type      default_type   default_expression   comment   codec_expression   ttl_expression Path        String                                                  ZSTD(3) Value       Float64                                                 Gorilla, LZ4 Time        UInt32                                                  DoubleDelta, LZ4 Date        Date                                                    DoubleDelta, LZ4 Timestamp   UInt32                                                  DoubleDelta, LZ4<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c, \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b <code>tables<\/code> \u0438 <code>columns<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0438\u0441\u0447\u0435\u0440\u043f\u044b\u0432\u0430\u044e\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u043c\u043f\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/0y\/ll\/zy\/0yllzyq6jf6ybnolejtqmriduww.png\"><\/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-314462","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/314462","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=314462"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/314462\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=314462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=314462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=314462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}