{"id":417465,"date":"2024-06-30T01:35:04","date_gmt":"2024-06-30T01:35:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=417465"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-30T01:35:04","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=417465","title":{"rendered":"<span>Spill-\u0444\u0430\u0439\u043b\u044b \u0432 Greenplum<\/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<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/963\/1dd\/6cb\/9631dd6cb2a7254e7cf49b7ae6b66ef3.png\" width=\"4586\" height=\"2088\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/963\/1dd\/6cb\/9631dd6cb2a7254e7cf49b7ae6b66ef3.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u0441\u043e spill-\u0444\u0430\u0439\u043b\u0430\u043c\u0438, \u0430 \u043c\u043e\u0436\u0435\u0442, \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0435 \u0438\u0445. \u0412 \u0441\u0435\u0442\u0438 \u043c\u0430\u043b\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u0438 \u043f\u043e\u0441\u0442\u043e\u0432 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u0432\u0441\u0451, \u0447\u0442\u043e \u0437\u043d\u0430\u044e \u043e \u0441\u043f\u0438\u043b\u043b\u0430\u0445, \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u0438 \u0435\u0441\u0442\u044c \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435, \u0438 \u043a\u0430\u043a \u0438\u0445 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c.<\/p>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041d\u0438\u043a\u043e\u043b\u0430\u0439, \u044f BI-\u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a. \u041e\u0434\u043d\u0430 \u0438\u0437 \u043c\u043e\u0438\u0445 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u2014 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a GreenPlum, \u043f\u0440\u0438\u0447\u0435\u043c \u0442\u0430\u043a\u0438\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0443\u0440\u043e\u043d\u044f\u0442 \u0431\u0430\u0437\u0443 \u0438 \u043d\u0435 \u043d\u0430\u0432\u043b\u0435\u043a\u0443\u0442 \u0430\u0434\u043c\u0438\u043d\u0441\u043a\u0438\u0439 \u0433\u043d\u0435\u0432.<\/p>\n<p>\u041c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435.<\/p>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043f\u043e\u043d\u044f\u0442\u0438\u044f\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 GreenPlum, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u0432\u044b \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u043f\u043b\u0430\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.\u00a0<\/p>\n<p>\u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0431\u0443\u0434\u0443 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0434\u0432\u0443\u0445 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445.<\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u2014 prod_wrk.applications. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 1 831 606 562 \u0441\u0442\u0440\u043e\u043a. DDL:<\/p>\n<pre><code class=\"sql\">CREATE TABLE prod_wrk.applications (    id bigint,    first_name character varying(32),    last_name character varying(32),    patronymic character varying(60),    birth_dt timestamp(0) without time zone,    phone_mobile character varying(16),    phone_work character varying(16),    additional_work_phone character varying(16),    phone_home character varying(16),    additional_phone_home character varying(16),    email character varying(50),    region character varying(255),    product_category character varying(50),    dt_created timestamp(0) without time zone,    some_foreign_key_1 character varying(255),    some_foreign_key_2 character varying(255),    some_foreign_key_3 character varying(255),    some_foreign_key_4 character varying(255),    some_foreign_key_5 character varying(255),    some_foreign_key_6 character varying(255),    some_foreign_key_7 character varying(255),    some_foreign_key_8 character varying(255),    some_foreign_key_9 character varying(255),    some_foreign_key_10 character varying(255),    some_foreign_key_11 character varying(255),    some_foreign_key_12 character varying(255),    some_foreign_key_13 character varying(255),    some_foreign_key_14 character varying(255),    some_foreign_key_15 character varying(255),    some_foreign_key_16 character varying(255),    some_foreign_key_17 character varying(255), ) WITH (APPENDONLY=true, ORIENTATION=column, COMPRESSTYPE=quicklz) DISTRIBUTED BY (id)<\/code><\/pre>\n<p>\u0412\u0442\u043e\u0440\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 key-param-value &#8212; prod_wrk.applications_extra_fields. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 4 328\u00a0017 \u0441\u0442\u0440\u043e\u043a. DDL:<\/p>\n<pre><code class=\"sql\">CREATE TABLE prod_wrk.applications_extra_fields (   id bigint,   name character varying(100),   value character varying(255) ) WITH (APPENDONLY=true, ORIENTATION=column, COMPRESSTYPE=quicklz) DISTRIBUTED BY (id)<\/code><\/pre>\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e spill-\u0444\u0430\u0439\u043b\u0430\u0445<\/h2>\n<p>Spill-\u0444\u0430\u0439\u043b\u044b, \u0441\u043f\u0438\u043b\u043b\u044b \u2014 \u044d\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0436\u0435\u0441\u0442\u043a\u043e\u043c \u0434\u0438\u0441\u043a\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>\u0421\u043f\u0438\u043b\u043b\u044b \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0443\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442 650 \u0413\u0431 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0434 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e 500 \u0413\u0431 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412 \u0438\u0442\u043e\u0433\u0435 650 \u2212 500 = 150 \u0413\u0431\u00a0 \u2014 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u0432\u0435\u0440\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0441\u043f\u0438\u043b\u043b\u043e\u0432.<\/p>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u043f\u043b\u043e\u0445\u043e, \u043a\u043e\u0433\u0434\u0430 \u0441\u043f\u0438\u043b\u043b\u043e\u0432 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e?<\/p>\n<p><strong>\u0421\u0442\u0440\u0430\u0434\u0430\u0435\u0442\u0435 \u0432\u044b<\/strong>. \u0421\u043f\u0438\u043b\u043b\u044b \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043d\u0430 \u0436\u0435\u0441\u0442\u043a\u043e\u043c \u0434\u0438\u0441\u043a\u0435, \u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 \u0436\u0435\u0441\u0442\u043a\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430 \u0432 \u0440\u0430\u0437\u044b \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0438\u0437 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p><strong>\u0421\u0442\u0440\u0430\u0434\u0430\u044e\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438<\/strong>. \u041f\u043e\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441, \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0434\u043e\u043b\u0433\u043e \u0436\u0434\u0443\u0442 \u0441\u0432\u043e\u0435\u0439 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430. \u041e\u0447\u0435\u0440\u0435\u0434\u044c \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c \u0440\u0430\u0441\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0441 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043b\u0438\u0448\u044c \u043a \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0434\u043d\u044f.<\/p>\n<p><strong>\u0421\u0442\u0440\u0430\u0434\u0430\u044e\u0442 \u0430\u0434\u043c\u0438\u043d\u044b \u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0432 \u0446\u0435\u043b\u043e\u043c<\/strong>. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0432 \u0432\u0430\u0448\u0435\u043c GreenPlum 250 \u0422\u0431 \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 20 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0437\u0430\u043f\u0443\u0441\u0442\u044f\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u043d\u0430\u0433\u0435\u043d\u0435\u0440\u0438\u0442 2,5 \u0422\u0431 \u0441\u043f\u0438\u043b\u043b\u043e\u0432, \u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u043e\u043a\u043e\u043b\u043e 1\/6 (50 \u0422\u0431) \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0437\u0430\u043d\u044f\u0442\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u043d\u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u0430 \u0432\u0435\u0434\u044c \u044d\u0442\u043e \u043c\u0435\u0441\u0442\u043e \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0435. \u0418 \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0441\u0442\u0430\u043d\u0443\u0442\u0441\u044f, \u0442\u043e \u043d\u0430\u0447\u043d\u0443\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e.<\/p>\n<p>\u0412 \u0438\u0434\u0435\u0430\u043b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u043f\u0438\u043b\u043b\u043e\u0432, \u043d\u043e \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0438\u0445 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u044a\u0435\u043c. \u0421\u043f\u0438\u043b\u043b\u044b \u0441\u0430\u043c\u0438 \u043f\u043e \u0441\u0435\u0431\u0435 \u043d\u0435 \u0437\u043b\u043e, \u0430 \u0433\u0438\u0431\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u043e\u0431\u044a\u0435\u043c\u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0417\u043b\u043e \u2014 \u043a\u043e\u0433\u0434\u0430 \u0438\u0445 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0435 \u0437\u043b\u043e \u2014 \u043a\u043e\u0433\u0434\u0430 \u0438\u0445 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c GreenPlum.<\/p>\n<h2>\u041e\u0442\u043b\u043e\u0432 \u0438 \u043f\u043e\u0434\u0441\u0447\u0435\u0442 \u0441\u043f\u0438\u043b\u043b\u043e\u0432<\/h2>\n<p>\u0423\u0437\u043d\u0430\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0447\u043d\u043e \u0441\u043f\u0438\u043b\u043b\u043e\u0432 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441, \u043d\u0435\u043b\u044c\u0437\u044f. \u041c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043b\u0438\u0448\u044c \u043e\u0431\u044a\u0435\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u043f\u0438\u043b\u043b\u043e\u0432 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 EXPLAIN ANALYZE.<\/p>\n<p><strong>\u0421\u043f\u043e\u0441\u043e\u0431 \u2116 1. \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b gp_toolkit.gp_workfile_usage_per_query<\/strong><\/p>\n<p>\u0412 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435: \u043a\u0442\u043e, \u043a\u0430\u043a\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u043f\u0438\u043b\u043b\u043e\u0432 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435.<\/p>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u044d\u0442\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u0432 \u0446\u0435\u043b\u044f\u0445 \u0441\u0430\u043c\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0410\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430\u043c \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u0434\u043b\u044f \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u0441\u043f\u0438\u043b\u043b\u043e\u0432, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043d\u0430\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442 \u0447\u0440\u0435\u0437\u043c\u0435\u0440\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u043b\u043b\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u0438 \u0443\u0431\u0438\u0432\u0430\u0442\u044c \u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043e\u0431\u044a\u0435\u043c \u0441\u043f\u0438\u043b\u043b\u043e\u0432 \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u0448\u0442\u0440\u0430\u0444\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c gp_toolkit.gp_workfile_usage_per_query. \u0422\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438 \u043e\u0431\u044a\u0435\u043c \u0432 \u0413\u0431 \u0441\u043f\u0438\u043b\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432\u0430\u0448\u0438\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<pre><code class=\"sql\">select   current_query   ,sum(size) \/ 1024 \/ 1024 \/ 1024 :: float size_spill_files_gb   ,sum(numfiles) count_spill_files from   gp_toolkit.gp_workfile_usage_per_query where   usename = current_user group by   current_query<\/code><\/pre>\n<p><strong>\u041f\u043b\u044e\u0441\u044b<\/strong><\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u0447\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u0441\u043f\u0438\u043b\u043b\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u0438\u043d\u0443\u0441\u044b<\/strong><\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043c \u043b\u0438\u0448\u044c \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043f\u0438\u043b\u043b\u044b \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 gp_toolkit.gp_workfile_usage_per_query \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0432\u043d\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434, \u0447\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043f\u0438\u043b\u043b\u044b.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043b\u044c\u0437\u044f \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0421\u043f\u043e\u0441\u043e\u0431 \u2116 2. \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <em>EXPLAIN ANALYZE<\/em>\u00a0<\/strong><\/p>\n<p>\u0420\u0430\u0431\u043e\u0442\u0443 \u0441 EXPLAIN ANALYZE \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440. \u0418\u043c\u0435\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043f\u0438\u043b\u043b\u044b:<\/p>\n<pre><code class=\"sql\">select   aef.name   ,aef.value   ,aef.id   ,a.* from   prod_wrk.applications_extra_fields as aef   left join prod_wrk.applications as a     on aef.id = a.id<\/code><\/pre>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 EXPLAIN ANALYZE, \u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c gp_toolkit.gp_workfile_usage_per_query. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 \u0441\u043f\u0430\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 gp_toolkit.gp_workfile_usage_per_query \u0432\u044b\u044f\u0441\u043d\u044f\u0435\u043c, \u0447\u0442\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0431\u044b\u043b\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043e\u043a\u043e\u043b\u043e 344 \u0413\u0431 \u0441\u043f\u0438\u043b\u043b\u043e\u0432:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f09\/435\/ed9\/f09435ed905c3d53186cd647243f429f.png\" width=\"969\" height=\"672\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f09\/435\/ed9\/f09435ed905c3d53186cd647243f429f.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0438\u0437\u0443\u0447\u0438\u043c \u043f\u043b\u0430\u043d \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u0442 EXPLAIN ANALYZE, \u0441\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u0441\u044f \u0432 \u0441\u0430\u043c\u044b\u0439 \u043d\u0438\u0437, \u0432 \u0441\u0435\u043a\u0446\u0438\u044e Slice statistic. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u043b\u0430\u0439\u0441 \u2116 1:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2bb\/000\/923\/2bb0009234cbaabd0e13f1c09d468a8f.png\" width=\"1838\" height=\"197\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2bb\/000\/923\/2bb0009234cbaabd0e13f1c09d468a8f.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u0441\u043b\u0430\u0439\u0441 \u043f\u043e\u043c\u0435\u0447\u0435\u043d \u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u043e\u0439 *, \u0437\u043d\u0430\u0447\u0438\u0442, \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u043f\u0438\u043b\u043b-\u0444\u0430\u0439\u043b\u043e\u0432. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u043f\u0438\u043b\u043b\u043e\u0432 \u043e\u0434\u043d\u0438\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0432\u043e\u0437\u043b\u0435 bytes wanted. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e 4 014 945 \u041a\u0431, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 3,82 \u0413\u0431, \u0430 \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0443 \u043d\u0430\u0441 144, \u0442\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u044a\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 550 \u0413\u0431. \u0415\u0441\u043b\u0438 \u0441\u043b\u0430\u0439\u0441\u043e\u0432 \u0441\u043e \u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u043e\u0439 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f bytes wanted. \u0417\u0430 \u0441\u0447\u0435\u0442 \u0441\u043b\u0430\u0439\u0441\u043e\u0432 \u0441\u043e \u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0438\u0437-\u0437\u0430 \u043a\u0430\u043a\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u043f\u0438\u043b\u043b\u043e\u0432. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e, \u0435\u0441\u043b\u0438 \u0434\u0436\u043e\u0439\u043d\u043e\u0432 \u0443 \u0432\u0430\u0441 \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0432\u0443\u0445.<\/p>\n<p>\u0421\u043f\u043e\u0441\u043e\u0431 \u2116 1 \u043d\u0430\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u043e\u0431\u044a\u0435\u043c \u0441\u043f\u0438\u043b\u043b\u043e\u0432 344 \u0413\u0431, \u0430 \u043f\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0443 \u2116 2 \u2014\u00a0550 \u0413\u0431. \u041f\u043e\u0447\u0435\u043c\u0443 \u0436\u0435 \u0442\u0430\u043a? \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e EXPLAIN ANALYZE \u0434\u0435\u043b\u0430\u0435\u0442 \u043b\u0438\u0448\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u0443\u044e \u043e\u0446\u0435\u043d\u043a\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u0432\u0442\u043e\u0440\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u043d\u0438\u0436\u043d\u044e\u044e \u043e\u0446\u0435\u043d\u043a\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043c\u0430 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0443\u043c 550 \u0413\u0431 \u0441\u043f\u0438\u043b\u043b-\u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<p><strong>\u041f\u043b\u044e\u0441\u044b<\/strong><\/p>\n<ul>\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u0438\u043d\u0443\u0441\u044b<\/strong><\/p>\n<ul>\n<li>\n<p>EXPLAIN ANALYZE \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u0443\u0436\u0430\u0441\u043d\u044b\u0439 \u0438 \u0443\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438, \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043c \u0441\u043f\u0438\u043b\u043b\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<h2>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 spill-\u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0438\u0445 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u043b\u043b\u043e\u0432 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0434\u043d\u0430 \u2014 \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0430 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0421\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0434\u0435\u0444\u0438\u0446\u0438\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e. \u0412\u043e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0445:<\/p>\n<ul>\n<li>\n<p>\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0435\u0437 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043c\u0430;<\/p>\n<\/li>\n<li>\n<p>DISTINCT \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u043b\u0435\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 ORDER BY.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0440\u0430\u0437\u0431\u0435\u0440\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0438 \u043e\u0431\u044a\u044f\u0441\u043d\u044e, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0432 \u043d\u0438\u0445 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0442\u044c.<\/p>\n<h2>\u041a\u0435\u0439\u0441 \u2116 1. \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0435\u0437 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432<\/h2>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u043b\u043b\u043e\u0432.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0434\u0436\u043e\u0438\u043d, \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u043e\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043c\u0435\u0441\u0442\u043e \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u043d\u044b, \u043f\u043e \u0441\u0443\u0442\u0438, \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0437\u0430\u0442\u043e\u043b\u043a\u0430\u0442\u044c \u0432\u0441\u044e \u0432\u0438\u0442\u0440\u0438\u043d\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c. \u041d\u0435 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u043e\u043d\u0430 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u044c. \u0410 \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0441\u044f, \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043a\u0443\u0434\u0430-\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0434\u0436\u043e\u0438\u043d\u0430, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u043c\u0435\u0441\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u0442\u044c \u2014 \u0438 \u043d\u0430\u0447\u043d\u0435\u0442\u0441\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u043f\u0438\u043b\u043b\u043e\u0432.<\/p>\n<p><strong>\u041a\u0430\u043a \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f<\/strong>. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u043d\u0430 \u0434\u0430\u0442\u044b \u0438 \u0432\u0440\u0435\u043c\u044f. \u041e\u0447\u0435\u043d\u044c \u0441\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0443 \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043e\u0431\u044a\u0435\u043c\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430 \u0432\u0441\u0451 \u0432\u0440\u0435\u043c\u044f. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u0430 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0440\u0435\u043c\u0435\u043d, \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0438, \u0438 \u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 UNION ALL. \u0421\u0435\u0440\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435, \u0447\u0435\u043c \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u0440\u0430\u0437\u043e\u043c.<\/p>\n<h2>\u041a\u0435\u0439\u0441 \u2116 2. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043c\u0430<\/h2>\n<p>\u041e\u0442\u0447\u0430\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u0435\u0439\u0441 \u0441\u0445\u043e\u0436 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u043a\u0435\u0439\u0441\u043e\u043c, \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0438 \u043f\u0440\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0442\u0430\u0431\u043b\u0438\u0446.<\/p>\n<p>\u041e\u0431\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c\u044b\u0445 \u0432 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u0432\u0443\u0445 \u0432\u0435\u0449\u0435\u0439: \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u043a \u0438 \u043a\u043e\u043b-\u0432\u0430 \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u043e\u043b\u0435\u0439.<\/p>\n<p>\u041f\u0440\u0438 INNER JOIN \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u0441\u0442\u0440\u043e\u043a. \u041b\u043e\u0433\u0438\u0447\u043d\u043e, \u0432\u0435\u0434\u044c \u043b\u0443\u0447\u0448\u0435 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u0435\u043d\u044c\u0448\u0438\u0439 \u043e\u0431\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0438 LEFT JOIN \u2014 \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0438 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0430\u00a0\u0432\u0441\u0435\u0433\u0434\u0430\u00a0\u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u0430\u0432\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0435\u0435 \u043e\u0431\u044a\u0435\u043c.\u00a0<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f8f\/4fa\/d70\/f8f4fad703aaed69edd36da6a47e5f78.png\" width=\"890\" height=\"433\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f8f\/4fa\/d70\/f8f4fad703aaed69edd36da6a47e5f78.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0435\u043d\u0430\u0440\u043e\u043a\u043e\u043c \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u0432\u0438\u0434\u0430 \u00ab\u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f_\u0442\u0430\u0431\u043b\u0438\u0446\u0430 LEFT JOIN \u0431\u043e\u043b\u044c\u0448\u0430\u044f_\u0442\u0430\u0431\u043b\u0438\u0446\u0430\u00bb, \u0447\u0435\u043c \u0437\u0430\u0431\u044c\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u043d\u0430\u0447\u043d\u0435\u043c \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0438\u043b\u043b\u044b.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u0432 SELECT, WHERE \u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0434\u0436\u043e\u0439\u043d\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u043b\u0435\u0439 \u0432 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435. \u0427\u0435\u043c \u0438\u0445 \u0431\u043e\u043b\u044c\u0448\u0435 \u2014 \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043e\u0431\u044a\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u044f\u0442.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u2116 1:<\/p>\n<pre><code class=\"sql\">select   aef.name   ,aef.value   ,aef.id   ,a.* from   prod_wrk.applications_extra_fields as aef   left join prod_wrk.applications as a     on aef.id = a.id<\/code><\/pre>\n<p>\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u044f \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b, \u0447\u0442\u043e \u043e\u0431\u044a\u0435\u043c \u0441\u0442\u0440\u043e\u043a \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 prod_wrk.applications \u2014 1 831 606 562, \u0430 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 prod_wrk.applications_extra_fields 4 328\u00a0017 \u0441\u0442\u0440\u043e\u043a. EXPLAIN ANALYZE \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043d\u0438\u0436\u0435:  <\/p>\n<pre><code>QUERY PLAN Gather Motion 144:1  (slice1; segments: 144)  (cost=0.00..238481.48 rows=8656034 width=654)   Rows out:  4328017 rows at destination with 24367 ms to first row, 65561 ms to end.   ->  Hash Left Join  (cost=0.00..225847.13 rows=60112 width=654)         Hash Cond: applications_extra_fields.id = applications.id         Rows out:  Avg 30055.7 rows x 144 workers.  Max 30572 rows (seg125) with 33702 ms to first row, 48803 ms to end.         Executor memory:  1003773K bytes avg, 1005792K bytes max (seg97).         Work_mem used:  1003773K bytes avg, 1005792K bytes max (seg97). Workfile: (144 spilling)         Work_mem wanted: 4011233K bytes avg, 4014945K bytes max (seg115) to lessen workfile I\/O affecting 144 workers.         (seg115) Initial batch 0:         (seg115)   Wrote 2899696K bytes to inner workfile.         (seg115)   Wrote 1248K bytes to outer workfile.         (seg115) Initial batches 1..3:         (seg115)   Read 2899005K bytes from inner workfile: 966335K avg x 3 nonempty batches, 967097K max.         (seg115)   Read 1261K bytes from outer workfile: 421K avg x 3 nonempty batches, 423K max.         (seg115) Hash chain length 3.2 avg, 16 max, using 3991901 of 4194304 buckets.         ->  Table Scan on applications_extra_fields  (cost=0.00..431.84 rows=30056 width=37)               Rows out:  Avg 30055.7 rows x 144 workers.  Max 30572 rows (seg125) with 29 ms to first row, 37 ms to end.         ->  Hash  (cost=4845.30..4845.30 rows=12719490 width=617)               Rows in:  Avg 3180162.9 rows x 144 workers.  Max 3185478 rows (seg83) with 38691 ms to end, start offset by 15 ms.               ->  Table Scan on applications  (cost=0.00..4845.30 rows=12719490 width=617)                     Rows out:  Avg 12719490.0 rows x 144 workers.  Max 12719888 rows (seg57) with 8.758 ms to first row, 16397 ms to end. Slice statistics:   (slice0)    Executor memory: 582K bytes.   (slice1)  * Executor memory: 1471761K bytes avg x 144 workers, 1471867K bytes max (seg117).  Work_mem: 1005792K bytes max, 4014945K bytes wanted. Statement statistics:   Memory used: 2555904K bytes   Memory wanted: 4015344K bytes Settings:  gp_enable_relsize_collection=on; optimizer_join_arity_for_associativity_commutativity=18 Optimizer status: PQO version 3.111.0 Total runtime: 65731.204 ms<\/code><\/pre>\n<p>\u0418\u0437 \u043f\u043b\u0430\u043d\u0430 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e:<\/p>\n<ul>\n<li>\n<p>\u0445\u044d\u0448 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043d\u0430 \u043e\u0433\u0440\u043e\u043c\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 applications;<\/p>\n<\/li>\n<li>\n<p>\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0441\u043f\u0438\u043b\u043b\u044b \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0441\u043b\u0430\u0439\u0441\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u2014 65 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041a\u0430\u043a \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f<\/strong>. \u0421\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0441\u043f\u0438\u043b\u043b\u043e\u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e. \u041f\u0435\u0440\u0432\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0438 \u0441\u0430\u043c\u044b\u0439 \u043d\u0430\u0438\u0432\u043d\u044b\u0439 \u2014 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0445\u044d\u0448. \u042d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043f\u0443\u0442\u0435\u043c \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u043b\u0438\u0431\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c\u044b\u0445 \u043f\u043e\u043b\u0435\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0440\u044f\u0434 \u043b\u0438 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0435\u0441\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043d\u044b\u0439 \u0441\u043e\u0441\u0442\u0430\u0432 \u0432\u0438\u0442\u0440\u0438\u043d\u044b. \u0418\u0437\u043c\u0435\u043d\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441, \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c\u044b\u0445 \u043f\u043e\u043b\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b applications:<\/p>\n<pre><code class=\"sql\">select   aef.name   ,aef.value   ,aef.id   ,a.dt_created   ,a.product_category    ,a.some_foreign_key_1 from   prod_wrk.applications_extra_fields as aef   left join prod_wrk.applications as a     on aef.id = a.id<\/code><\/pre>\n<p>\u041f\u043b\u0430\u043d \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043d\u0438\u0436\u0435:<\/p>\n<pre><code>QUERY PLAN Gather Motion 144:1  (slice1; segments: 144)  (cost=0.00..24457.91 rows=8656034 width=74)   Rows out:  4328017 rows at destination with 8567 ms to first row, 18771 ms to end.   ->  Hash Left Join  (cost=0.00..23028.33 rows=60112 width=74)         Hash Cond: applications_extra_fields.id = applications.id         Rows out:  Avg 30055.7 rows x 144 workers.  Max 30572 rows (seg125) with 9182 ms to first row, 9849 ms to end.         Executor memory:  561745K bytes avg, 561825K bytes max (seg118).         Work_mem used:  561745K bytes avg, 561825K bytes max (seg118). Workfile: (0 spilling)         (seg125) Hash chain length 1.9 avg, 11 max, using 6547487 of 8388608 buckets.         ->  Table Scan on applications_extra_fields  (cost=0.00..431.84 rows=30056 width=37)               Rows out:  Avg 30055.7 rows x 144 workers.  Max 30572 rows (seg125) with 13 ms to first row, 18 ms to end.         ->  Hash  (cost=4845.30..4845.30 rows=12719490 width=45)               Rows in:  Avg 12719490.0 rows x 144 workers.  Max 12719888 rows (seg57) with 16865 ms to end, start offset by 292 ms.               ->  Table Scan on applications  (cost=0.00..4845.30 rows=12719490 width=45)                     Rows out:  Avg 12719490.0 rows x 144 workers.  Max 12719888 rows (seg57) with 4.584 ms to first row, 6608 ms to end. Slice statistics:   (slice0)    Executor memory: 514K bytes.   (slice1)    Executor memory: 1180565K bytes avg x 144 workers, 1180565K bytes max (seg0).  Work_mem: 561825K bytes max. Statement statistics:   Memory used: 2555904K bytes Settings:  gp_enable_relsize_collection=on; optimizer_join_arity_for_associativity_commutativity=18 Optimizer status: PQO version 3.111.0 Total runtime: 18920.442 ms<\/code><\/pre>\n<p>\u0418\u0437 \u043f\u043b\u0430\u043d\u0430 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e:<\/p>\n<ul>\n<li>\n<p>\u0445\u044d\u0448 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 applications;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043f\u0438\u043b\u043b\u044b \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043b\u043e\u0441\u044c \u2014 18 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434:\u00a0\u0447\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0432\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435, \u0442\u0435\u043c \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043e\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f. GreenPlum \u2014 \u044d\u0442\u043e \u0431\u0430\u0437\u0430 \u0441\u00a0\u043f\u043e\u043a\u043e\u043b\u043e\u043d\u043e\u0447\u043d\u044b\u043c\u00a0\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c. \u0427\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u043a\u043e\u043b\u043e\u043d\u043e\u043a, \u0442\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0438\u0439 \u043e\u0431\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0438 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>\u0414\u0440\u0443\u0433\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u043f\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0443 \u0443\u0440\u0435\u0437\u0430\u043b\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0438 \u043a\u043e\u043b\u043e\u043d\u043e\u043a. \u0422\u0443\u0442 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0445\u044d\u0448 \u043d\u0430 \u043c\u0435\u043d\u044c\u0448\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438: \u043b\u0438\u0431\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c LEFT JOIN \u043d\u0430 INNER JOIN, \u043b\u0438\u0431\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u0440\u0438 LEFT JOIN. \u0417\u0430\u043c\u0435\u043d\u0438\u043c LEFT \u043d\u0430 INNER \u0432 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435:<\/p>\n<pre><code class=\"sql\">select   aef.name   ,aef.value   ,aef.id   ,a.* from   prod_wrk.applications_extra_fields as aef   inner join prod_wrk.applications as a     on aef.id = a.id<\/code><\/pre>\n<p>\u041f\u043b\u0430\u043d \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043d\u0438\u0436\u0435:  <\/p>\n<pre><code>QUERY PLAN Gather Motion 144:1  (slice1; segments: 144)  (cost=0.00..33280.61 rows=4328017 width=654)   Rows out:  1952503 rows at destination with 3301 ms to first row, 34665 ms to end.   ->  Hash Join  (cost=0.00..26963.43 rows=30056 width=654)         Hash Cond: applications.id = applications_extra_fields.id         Rows out:  Avg 13559.0 rows x 144 workers.  Max 13878 rows (seg127) with 483 ms to first row, 20343 ms to end.         Executor memory:  2034K bytes avg, 2067K bytes max (seg125).         Work_mem used:  2034K bytes avg, 2067K bytes max (seg125). Workfile: (0 spilling)         (seg127) Hash chain length 1.0 avg, 3 max, using 29968 of 4194304 buckets.         ->  Table Scan on applications  (cost=0.00..4845.30 rows=12719490 width=617)               Rows out:  Avg 12719490.0 rows x 144 workers.  Max 12719888 rows (seg57) with 114 ms to first row, 26154 ms to end.         ->  Hash  (cost=431.84..431.84 rows=30056 width=37)               Rows in:  Avg 30055.7 rows x 144 workers.  Max 30572 rows (seg125) with 26 ms to end, start offset by 70 ms.               ->  Table Scan on applications_extra_fields  (cost=0.00..431.84 rows=30056 width=37)                     Rows out:  Avg 30055.7 rows x 144 workers.  Max 30572 rows (seg125) with 2.260 ms to first row, 9.303 ms to end. Slice statistics:   (slice0)    Executor memory: 590K bytes.   (slice1)    Executor memory: 75065K bytes avg x 144 workers, 75067K bytes max (seg117).  Work_mem: 2067K bytes max. Statement statistics:   Memory used: 2555904K bytes Settings:  gp_enable_relsize_collection=on; optimizer_join_arity_for_associativity_commutativity=18 Optimizer status: PQO version 3.111.0 Total runtime: 34748.601 ms<\/code><\/pre>\n<p>\u0418\u0437 \u043f\u043b\u0430\u043d\u0430 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e:<\/p>\n<ul>\n<li>\n<p>\u0445\u044d\u0448 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043d\u0430 \u043c\u0435\u043d\u044c\u0448\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 applications_extra_fields;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043f\u0438\u043b\u043b\u044b \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u2014 34 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u0434\u0430\u0436\u0435 \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0432\u0441\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b applications!<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u0430 LEFT \u043d\u0430 INNER \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0442\u0430\u0431\u043b\u0438\u0446 \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u043c\u0435\u043d\u044f\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0415\u0441\u043b\u0438 \u0432\u0430\u0436\u043d\u043e \u0435\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c, \u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 CTE, \u043f\u043e\u0434\u0437\u0430\u043f\u0440\u043e\u0441 \u0438\u043b\u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443. \u041d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 CTE:<\/p>\n<pre><code class=\"sql\">with pre_join as ( select   a.* from   prod_wrk.applications_extra_fields as aef   inner join prod_wrk.applications as a     on aef.id = a.id ) select   aef.name   ,aef.value   ,aef.id   ,a.* from   prod_wrk.applications_extra_fields as aef   left join pre_join as a     on aef.id = a.id<\/code><\/pre>\n<p>\u041f\u043b\u0430\u043d \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430:  <\/p>\n<pre><code>QUERY PLAN Gather Motion 144:1  (slice1; segments: 144)  (cost=0.00..40573.86 rows=8656034 width=654)   Rows out:  4385665 rows at destination with 11395 ms to first row, 26902 ms to end.   ->  Hash Left Join  (cost=0.00..27939.50 rows=60112 width=654)         Hash Cond: prod_wrk.applications_extra_fields.id = applications.id         Rows out:  Avg 30456.0 rows x 144 workers.  Max 30966 rows (seg125) with 12956 ms to first row, 13011 ms to end.         Executor memory:  28739K bytes avg, 29410K bytes max (seg121).         Work_mem used:  28739K bytes avg, 29410K bytes max (seg121). Workfile: (0 spilling)         (seg125) Hash chain length 1.0 avg, 4 max, using 13291 of 262144 buckets.         ->  Table Scan on applications_extra_fields  (cost=0.00..431.84 rows=30056 width=37)               Rows out:  Avg 30055.7 rows x 144 workers.  Max 30572 rows (seg125) with 0.593 ms to first row, 10 ms to end.         ->  Hash  (cost=26938.13..26938.13 rows=30056 width=617)               Rows in:  Avg 13559.0 rows x 144 workers.  Max 13878 rows (seg127) with 13689 ms to end, start offset by 6.996 ms.               ->  Hash Join  (cost=0.00..26938.13 rows=30056 width=617)                     Hash Cond: applications.id = prod_wrk.applications_extra_fields.id                     Rows out:  Avg 13559.0 rows x 144 workers.  Max 13878 rows (seg127) with 372 ms to first row, 13628 ms to end.                     Executor memory:  940K bytes avg, 956K bytes max (seg125).                     Work_mem used:  940K bytes avg, 956K bytes max (seg125). Workfile: (0 spilling)                     (seg127) Hash chain length 1.0 avg, 3 max, using 29968 of 4194304 buckets.                     ->  Table Scan on applications  (cost=0.00..4845.30 rows=12719490 width=617)                           Rows out:  Avg 12719490.0 rows x 144 workers.  Max 12719888 rows (seg57) with 7.392 ms to first row, 20819 ms to end.                     ->  Hash  (cost=431.84..431.84 rows=30056 width=8)                           Rows in:  Avg 30055.7 rows x 144 workers.  Max 30572 rows (seg125) with 15 ms to end, start offset by 69 ms.                           ->  Table Scan on applications_extra_fields  (cost=0.00..431.84 rows=30056 width=8)                                 Rows out:  Avg 30055.7 rows x 144 workers.  Max 30572 rows (seg125) with 1.150 ms to first row, 4.730 ms to end. Slice statistics:   (slice0)    Executor memory: 582K bytes.   (slice1)    Executor memory: 126241K bytes avg x 144 workers, 126243K bytes max (seg117).  Work_mem: 29410K bytes max. Statement statistics:   Memory used: 2555904K bytes Settings:  gp_enable_relsize_collection=on; optimizer_join_arity_for_associativity_commutativity=18 Optimizer status: PQO version 3.111.0 Total runtime: 27070.592 ms <\/code><\/pre>\n<p>\u0418\u0437 \u043f\u043b\u0430\u043d\u0430 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e:<\/p>\n<ul>\n<li>\n<p>\u0445\u044d\u0448 \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043d\u0430 \u043c\u0435\u043d\u044c\u0448\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 applications_extra_fields;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043f\u0438\u043b\u043b\u044b \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f;<\/p>\n<\/li>\n<li>\n<p>\u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u2014 27 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u0434\u0430\u0436\u0435 \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0432\u0441\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b applications!<\/p>\n<p>\u0421\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 INNER JOIN \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438. \u0415\u0441\u043b\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0442\u043e\u0440 \u0441\u0442\u0440\u043e\u0438\u0442 \u0445\u044d\u0448 \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446, \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0432 \u0434\u0436\u043e\u0438\u043d\u0435.<\/p>\n<h2>\u041a\u0435\u0439\u0441 \u2116 3. DISTINCT \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u043b\u0435\u0439<\/h2>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u0441\u043f\u0438\u043b\u043b\u044b? \u041a\u0430\u0436\u0434\u043e\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043f\u043e\u043b\u0435\u0439 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0442\u0430\u043a\u0438\u0445 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0439, \u0442\u0435\u043c \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u0437\u0430\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043f\u0438\u043b\u043b\u044b.<\/p>\n<p>\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043f\u043e\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044e\u0442 \u0432 DISTINCT. \u0422\u043e \u0435\u0441\u0442\u044c \u0447\u0435\u0442\u044b\u0440\u0435 \u043f\u043e\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u043f\u043e 8 \u0431\u0430\u0439\u0442\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0430\u043c\u044f\u0442\u0438, \u0447\u0435\u043c 12 \u043f\u043e\u043b\u0435\u0439 \u043f\u043e 1 \u0431\u0430\u0439\u0442\u0443 \u043a\u0430\u0436\u0434\u043e\u0435, \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0440\u0430\u0432\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u043a.<\/p>\n<p><strong>\u041a\u0430\u043a \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f<\/strong>. \u0421\u043e\u043a\u0440\u0430\u0449\u0430\u0439\u0442\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u0435\u0439 \u0432 DISTINCT. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0446\u0435\u043d\u043a\u0438 \u0441\u0432\u0435\u0440\u0445\u0443 \u0438 \u0441\u043d\u0438\u0437\u0443 \u043f\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u043c\u0443 \u043e\u0431\u044a\u0435\u043c\u0443 \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 DISTINCT. \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0446\u0435\u043d\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0415\u0441\u043b\u0438 \u0432\u0435\u0440\u0445\u043d\u044f\u044f \u0433\u0440\u0430\u043d\u0438\u0446\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0442\u044c \u00ab\u0448\u0442\u0440\u0430\u0444\u043d\u043e\u0439\u00bb \u043f\u043e\u0440\u043e\u0433, \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0432\u043e\u0437\u0434\u0435\u0440\u0436\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u041c\u0435\u0442\u043e\u0434 \u043e\u0446\u0435\u043d\u043a\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u043d \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0438\u0436\u0435:<\/p>\n<p>\u041f\u0443\u0441\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u043c DISTINCT \u0443\u0447\u0430\u0441\u0442\u0432\u0443\u044e\u0442 \u0442\u0440\u0438 \u043a\u043e\u043b\u043e\u043d\u043a\u0438: C<sub>1<\/sub>, C<sub>2<\/sub> \u0438 C<sub>3<\/sub>.<\/p>\n<p>\u041a\u0430\u0436\u0434\u0430\u044f \u043a\u043e\u043b\u043e\u043d\u043a\u0430 \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u0432 \u0431\u0430\u0439\u0442\u0430\u0445 (A<sub>i<\/sub>) \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (count(distinct C<sub>i<\/sub>) = D<sub>i<\/sub>).<\/p>\n<p>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043d\u0430\u0448\u0438 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0438\u043c\u0435\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 Ai \u0438 Di:<\/p>\n<ul>\n<li>\n<p>C<sub>1<\/sub> \u2014 A<sub>1<\/sub> = 16 \u0431\u0430\u0439\u0442, D<sub>1<\/sub> = 156;<\/p>\n<\/li>\n<li>\n<p>C<sub>2<\/sub> \u2014 A<sub>2<\/sub> = 8 \u0431\u0430\u0439\u0442, D<sub>2<\/sub> = 832;<\/p>\n<\/li>\n<li>\n<p>C<sub>3<\/sub> \u2014 A<sub>3<\/sub> = 4 \u0431\u0430\u0439\u0442\u0430, D<sub>3<\/sub> = 16.<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0443\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043e\u0431\u044a\u0435\u043c, \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u043c\u044b\u0439 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439. \u041e\u043d \u0440\u0430\u0432\u0435\u043d \u0441\u0443\u043c\u043c\u0435 A<sub>i<\/sub>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"A=\\sum_{i=1}^{n} A_i = A_1+A_2+A_3\" alt=\"A=\\sum_{i=1}^{n} A_i = A_1+A_2+A_3\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ee2\/1ca\/495\/ee21ca49520564a1b7590f20092eeec7.svg\" width=\"235\" height=\"57\"\/><\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0410 = 16 + 8 + 4 = 28 \u0431\u0430\u0439\u0442 \u2014 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u0434\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a D.<\/p>\n<p>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a \u0440\u0430\u0432\u043d\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0443 \u0438\u0437 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 D = max(D<sub>i<\/sub>), \u0442\u043e \u0435\u0441\u0442\u044c D = D<sub>2<\/sub> = 832. \u041f\u043e\u0447\u0435\u043c\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0442\u043e\u043b\u044c\u043a\u043e? \u041c\u0438\u043d\u0438\u043c\u0443\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e 832 \u0441\u0442\u0440\u043e\u043a\u0438, \u044d\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u0432\u043e \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u044f\u0445 \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 C<sub>2<\/sub> \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u043f\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0440\u0430\u0437\u0443. \u041c\u0435\u043d\u044c\u0448\u0435 \u0431\u044b\u0442\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442.<\/p>\n<p>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a \u0440\u0430\u0432\u043d\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044e \u0432\u0441\u0435\u0445 D<sub>i<\/sub>, \u0442\u043e \u0435\u0441\u0442\u044c:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"D=\\prod_{i=1}^{n} D_i=D_1\\times D_2 \\times D_3\" alt=\"D=\\prod_{i=1}^{n} D_i=D_1\\times D_2 \\times D_3\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/71b\/59f\/464\/71b59f464dd5b48ded6fee4aee162389.svg\" width=\"239\" height=\"57\"\/><\/p>\n<p>\u042d\u0442\u043e \u0441\u043b\u0443\u0447\u0430\u0439 \u0434\u0435\u043a\u0430\u0440\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u043a\u0430\u0436\u0434\u043e\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u0447\u0435\u0442\u0430\u0435\u0442\u0441\u044f \u0441 \u043a\u0430\u0436\u0434\u044b\u043c\u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0432\u0441\u0435\u0445 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432.\u00a0<\/p>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 D = 156 \u00d7 832 \u00d7 16 = 2 076 672 \u0441\u0442\u0440\u043e\u043a. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043e\u0431\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0439 \u0441\u0432\u0435\u0440\u0445\u0443 \u0438 \u0441\u043d\u0438\u0437\u0443:<\/p>\n<ul>\n<li>\n<p>\u043e\u0446\u0435\u043d\u043a\u0430 \u0441\u043d\u0438\u0437\u0443: A \u00d7 D = (A<sub>1<\/sub> + A<sub>2<\/sub> + A<sub>3<\/sub>) \u00d7 MAX(D<sub>i<\/sub>) = (16 + 8 + 4) \u00d7 832 = 23 296 \u0431\u0430\u0439\u0442\u0430 \u2248 22,75 \u041a\u0431;<\/p>\n<\/li>\n<li>\n<p>\u043e\u0446\u0435\u043d\u043a\u0430 \u0441\u0432\u0435\u0440\u0445\u0443: A \u00d7 D = (A<sub>1<\/sub> + A<sub>2<\/sub> + A<sub>3<\/sub>) \u00d7 (D<sub>1<\/sub> \u00d7 D<sub>2<\/sub> \u00d7 D<sub>3<\/sub>) = (16 + 8 + 4) \u00d7 (156 \u00d7 832 \u00d7 16) = 58 146 816 \u0431\u0430\u0439\u0442 \u2248 55,45 \u041c\u0431.<\/p>\n<\/li>\n<\/ul>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043e\u0442 22,75 \u041a\u0431 \u0434\u043e 55,45 \u041c\u0431. \u041e\u0431\u0449\u0430\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0430:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\\sum_{i=1}^{n}A_i \\times max(D_i)\\leq\u043f\u0430\u043c\u044f\u0442\u044c\\leq \\sum_{i=1}^{n}A_i\\times\\prod_{i=1}^{n}D_i\" alt=\"\\sum_{i=1}^{n}A_i \\times max(D_i)\\leq\u043f\u0430\u043c\u044f\u0442\u044c\\leq \\sum_{i=1}^{n}A_i\\times\\prod_{i=1}^{n}D_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c78\/54d\/e35\/c7854de351897439a1d6dcec0b4ad1f2.svg\" width=\"382\" height=\"57\"\/><\/p>\n<p>\u0433\u0434\u0435 n \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u043b\u043e\u043d\u043e\u043a, A<sub>i<\/sub> \u2014 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c i-\u043e\u0439 \u043a\u043e\u043b\u043e\u043d\u043a\u0438, D<sub>i<\/sub> \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 i-\u043e\u0439 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 (count(distinct C<sub>i<\/sub>)).<\/p>\n<p>\u0421 \u0440\u043e\u0441\u0442\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0441\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0441\u0442\u0435\u0442 \u043e\u0446\u0435\u043d\u043a\u0430 \u0441\u0432\u0435\u0440\u0445\u0443. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432 \u043f\u0440\u0438\u043c\u0435\u0440 \u0432\u044b\u0448\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0449\u0435 \u043e\u0434\u043d\u0443 \u043a\u043e\u043b\u043e\u043d\u043a\u0443 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c\u044e A<sub>4<\/sub> = 4 \u0431\u0430\u0439\u0442\u0430 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 D<sub>4<\/sub> = 60.\u00a0<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u0446\u0435\u043d\u043a\u0430 \u0441\u0432\u0435\u0440\u0445\u0443 \u0441\u0442\u0430\u043d\u0435\u0442:\u00a0<\/p>\n<p>A \u00d7 D = (A<sub>1<\/sub> + A<sub>2<\/sub> + A<sub>3<\/sub> + A<sub>4<\/sub>) \u00d7 (D<sub>1<\/sub> \u00d7 D<sub>2<\/sub> \u00d7 D<sub>3<\/sub> \u00d7 D<sub>4<\/sub>) = (16 + 8 + 4 + 4) \u00d7 (156 \u00d7 832 \u00d7 16 \u00d7 60) = 3 987 210 240 \u0431\u0430\u0439\u0442 \u2248 3,71 \u0413\u0431! \u0422\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u0432\u044b\u0440\u043e\u0441 \u043f\u043e\u0447\u0442\u0438 \u0432 68,5 \u0440\u0430\u0437\u0430!<\/p>\n<p>\u0421\u0430\u043c\u044b\u0439 \u0434\u0438\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0438 \u0432 \u043a\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c:<\/p>\n<pre><code class=\"sql\">select    distinct *  from    some_table<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0438\u043b\u0438 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439, \u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b \u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u0441\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c. \u0410 \u043a\u043e\u0433\u0434\u0430 \u043e\u043d\u0430 \u043d\u0435 \u0432\u043b\u0435\u0437\u0430\u0435\u0442, \u0442\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u043f\u0438\u043b\u043b\u043e\u0432.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043b\u043e\u043d\u043e\u043a, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e pg_column_size(column). \u041e\u043d\u0430 \u0432\u0435\u0440\u043d\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445.<\/p>\n<h2>\u041a\u0435\u0439\u0441 \u2116 4. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 ORDER BY<\/h2>\n<p>\u0410 \u0442\u0430\u043c-\u0442\u043e \u043e\u0442\u043a\u0443\u0434\u0430 \u0441\u043f\u0438\u043b\u043b\u044b? \u0412\u0441\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e. \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u0434\u0430\u0435\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438, GreenPlum \u0434\u043e\u043b\u0436\u0435\u043d \u0433\u0434\u0435-\u0442\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u0435\u0441\u0442\u043e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u2014 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c, \u0437\u0430\u0442\u0435\u043c \u2014 \u0436\u0435\u0441\u0442\u043a\u0438\u0439 \u0434\u0438\u0441\u043a, \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0430\u0447\u043d\u0435\u0442\u0441\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u043f\u0438\u043b\u043b\u043e\u0432. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043a \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043f\u0438\u043b\u043b\u043e\u0432 \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0441\u043f\u0438\u043b\u043b\u044b:<\/p>\n<pre><code class=\"sql\">explain analyze select   * from   prod_wrk.applications order by   dt_created   ,id<\/code><\/pre>\n<p>\u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e (\u0438\u043b\u0438 \u043a \u0441\u0447\u0430\u0441\u0442\u044c\u044e \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u0432), \u044f \u043d\u0435 \u0434\u043e\u0436\u0434\u0430\u043b\u0441\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043e\u0442\u043c\u0435\u043d\u0438\u043b \u0435\u0433\u043e. \u041e\u0434\u043d\u0430\u043a\u043e \u0432\u0441\u0435\u0433\u043e \u0437\u0430 \u043f\u0430\u0440\u0443 \u0441\u0435\u043a\u0443\u043d\u0434 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0443 \u0442\u0435\u0440\u0430\u0431\u0430\u0439\u0442\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bfc\/cfc\/eca\/bfccfceca71a7a746f1aa01188a69044.png\" width=\"998\" height=\"637\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bfc\/cfc\/eca\/bfccfceca71a7a746f1aa01188a69044.png\"\/><figcaption><\/figcaption><\/figure>\n<p><strong>\u041a\u0430\u043a \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f<\/strong>. \u041d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 ORDER BY, \u0441\u043e\u0432\u0441\u0435\u043c! \u0412 GreenPlum \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f ORDER BY \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0440\u0430\u0439\u043d\u0435 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e (\u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0441\u043f\u0438\u043b\u043b\u0430\u043c). \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430, \u0442\u043e \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0443\u0436\u0435 \u0432 \u043f\u0440\u0438\u0435\u043c\u043d\u0438\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 dBeaver, Excel, Tableau), \u0430 \u043d\u0435 \u0432 \u0441\u0430\u043c\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0435. \u0414\u043b\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 DISTINCT ON \u0438 \u043e\u043a\u043e\u043d\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u0435 ORDER BY. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u0435 \u043e\u0431\u044a\u0435\u043c \u0441\u0442\u0440\u043e\u043a, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043e\u0431\u044a\u0435\u043c\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435 \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 (\u0438\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u043e\u043b\u0433\u043e) \u0438 c\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043f\u0438\u043b\u043b\u043e\u0432.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u042f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0435 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043a\u0435\u0439\u0441\u044b, \u043e\u0434\u043d\u0430\u043a\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0447\u0430\u0441\u0442\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u0435\u0439\u0441\u0430\u0445, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<p>\u041a\u0440\u0430\u0442\u043a\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u044b:<\/p>\n<ol>\n<li>\n<p>\u041e\u0441\u043d\u043e\u0432\u0430 \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043f\u0438\u043b\u043b\u043e\u0432 \u2014 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u0435\u0434\u0438\u0442\u0435 \u0437\u0430 \u043e\u0431\u044a\u0435\u043c\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0439\u0442\u0435 \u0438\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043b\u0435\u0434\u0438\u0442\u0435 \u0437\u0430 \u0434\u0436\u043e\u0438\u043d\u0430\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u0443\u0432\u043b\u0435\u043a\u0430\u0439\u0442\u0435\u0441\u044c DISTINCT.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0437\u0431\u0435\u0433\u0430\u0439\u0442\u0435 ORDER BY.<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438.<\/p>\n<ul>\n<li>\n<p><a href=\"http:\/\/www.dbaref.com\/home\/greenplum-dba-quick-reference\/readingqueryplanoutputingreenplum\"><u>\u0427\u0442\u0435\u043d\u0438\u0435 \u043f\u043b\u0430\u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"http:\/\/www.dbaref.com\/greenplum-database-dba-references\/whatisdiskspillingreenplum\"><u>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 spill-files<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/metanit.com\/sql\/postgresql\/2.3.php\"><u>\u0420\u0430\u0437\u043c\u0435\u0440\u044b \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 Postgres<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.huihoo.com\/greenplum\/pivotal\/4.3.6\/gp_toolkit-topic32.html\"><u>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f spill-\u0444\u0430\u0439\u043b\u043e\u0432<\/u><\/a><\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/df8\/180\/e97\/df8180e97e31f260076c13ccc5663627.png\" width=\"4586\" height=\"2088\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/df8\/180\/e97\/df8180e97e31f260076c13ccc5663627.png\"\/><figcaption><\/figcaption><\/figure>\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\/579794\/\"> https:\/\/habr.com\/ru\/articles\/579794\/<\/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<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0447\u0438\u0442\u0430\u0435\u0442\u0435 \u044d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u0441\u043e spill-\u0444\u0430\u0439\u043b\u0430\u043c\u0438, \u0430 \u043c\u043e\u0436\u0435\u0442, \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0435 \u0438\u0445. \u0412 \u0441\u0435\u0442\u0438 \u043c\u0430\u043b\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u0438 \u043f\u043e\u0441\u0442\u043e\u0432 \u043d\u0430 \u044d\u0442\u0443 \u0442\u0435\u043c\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u0432\u0441\u0451, \u0447\u0442\u043e \u0437\u043d\u0430\u044e \u043e \u0441\u043f\u0438\u043b\u043b\u0430\u0445, \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u0438 \u0435\u0441\u0442\u044c \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435, \u0438 \u043a\u0430\u043a \u0438\u0445 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c.<\/p>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u041d\u0438\u043a\u043e\u043b\u0430\u0439, \u044f BI-\u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a. \u041e\u0434\u043d\u0430 \u0438\u0437 \u043c\u043e\u0438\u0445 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u2014 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a GreenPlum, \u043f\u0440\u0438\u0447\u0435\u043c \u0442\u0430\u043a\u0438\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0443\u0440\u043e\u043d\u044f\u0442 \u0431\u0430\u0437\u0443 \u0438 \u043d\u0435 \u043d\u0430\u0432\u043b\u0435\u043a\u0443\u0442 \u0430\u0434\u043c\u0438\u043d\u0441\u043a\u0438\u0439 \u0433\u043d\u0435\u0432.<\/p>\n<p>\u041c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435.<\/p>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043f\u043e\u043d\u044f\u0442\u0438\u044f\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 GreenPlum, \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e, \u0447\u0442\u043e \u0432\u044b \u0437\u043d\u0430\u043a\u043e\u043c\u044b \u0441 \u043f\u043b\u0430\u043d\u043e\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.\u00a0<\/p>\n<p>\u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0431\u0443\u0434\u0443 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u0434\u0432\u0443\u0445 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445.<\/p>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u2014 prod_wrk.applications. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 1 831 606 562 \u0441\u0442\u0440\u043e\u043a. DDL:<\/p>\n<pre><code class=\"sql\">CREATE TABLE prod_wrk.applications (    id bigint,    first_name character varying(32),    last_name character varying(32),    patronymic character varying(60),    birth_dt timestamp(0) without time zone,    phone_mobile character varying(16),    phone_work character varying(16),    additional_work_phone character varying(16),    phone_home character varying(16),    additional_phone_home character varying(16),    email character varying(50),    region character varying(255),    product_category character varying(50),    dt_created timestamp(0) without time zone,    some_foreign_key_1 character varying(255),    some_foreign_key_2 character varying(255),    some_foreign_key_3 character varying(255),    some_foreign_key_4 character varying(255),    some_foreign_key_5 character varying(255),    some_foreign_key_6 character varying(255),    some_foreign_key_7 character varying(255),    some_foreign_key_8 character varying(255),    some_foreign_key_9 character varying(255),    some_foreign_key_10 character varying(255),    some_foreign_key_11 character varying(255),    some_foreign_key_12 character varying(255),    some_foreign_key_13 character varying(255),    some_foreign_key_14 character varying(255),    some_foreign_key_15 character varying(255),    some_foreign_key_16 character varying(255),    some_foreign_key_17 character varying(255), ) WITH (APPENDONLY=true, ORIENTATION=column, COMPRESSTYPE=quicklz) DISTRIBUTED BY (id)<\/code><\/pre>\n<p>\u0412\u0442\u043e\u0440\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 key-param-value &#8212; prod_wrk.applications_extra_fields. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 4 328\u00a0017 \u0441\u0442\u0440\u043e\u043a. DDL:<\/p>\n<pre><code class=\"sql\">CREATE TABLE prod_wrk.applications_extra_fields (   id bigint,   name character varying(100),   value character varying(255) ) WITH (APPENDONLY=true, ORIENTATION=column, COMPRESSTYPE=quicklz) DISTRIBUTED BY (id)<\/code><\/pre>\n<h2>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e spill-\u0444\u0430\u0439\u043b\u0430\u0445<\/h2>\n<p>Spill-\u0444\u0430\u0439\u043b\u044b, \u0441\u043f\u0438\u043b\u043b\u044b \u2014 \u044d\u0442\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0436\u0435\u0441\u0442\u043a\u043e\u043c \u0434\u0438\u0441\u043a\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p>\u0421\u043f\u0438\u043b\u043b\u044b \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0443\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442 650 \u0413\u0431 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0434 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043e 500 \u0413\u0431 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0412 \u0438\u0442\u043e\u0433\u0435 650 \u2212 500 = 150 \u0413\u0431\u00a0 \u2014 \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u0432\u0435\u0440\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e\u0442 \u043e\u0431\u044a\u0435\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0441\u043f\u0438\u043b\u043b\u043e\u0432.<\/p>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u043f\u043b\u043e\u0445\u043e, \u043a\u043e\u0433\u0434\u0430 \u0441\u043f\u0438\u043b\u043b\u043e\u0432 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e?<\/p>\n<p><strong>\u0421\u0442\u0440\u0430\u0434\u0430\u0435\u0442\u0435 \u0432\u044b<\/strong>. \u0421\u043f\u0438\u043b\u043b\u044b \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u043d\u0430 \u0436\u0435\u0441\u0442\u043a\u043e\u043c \u0434\u0438\u0441\u043a\u0435, \u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 \u0436\u0435\u0441\u0442\u043a\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430 \u0432 \u0440\u0430\u0437\u044b \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u0438\u0437 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p><strong>\u0421\u0442\u0440\u0430\u0434\u0430\u044e\u0442 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438<\/strong>. \u041f\u043e\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u0430\u0448 \u0437\u0430\u043f\u0440\u043e\u0441, \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0434\u043e\u043b\u0433\u043e \u0436\u0434\u0443\u0442 \u0441\u0432\u043e\u0435\u0439 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430. \u041e\u0447\u0435\u0440\u0435\u0434\u044c \u043a \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c \u0440\u0430\u0441\u0442\u044f\u0433\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0441 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043b\u0438\u0448\u044c \u043a \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0435 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0434\u043d\u044f.<\/p>\n<p><strong>\u0421\u0442\u0440\u0430\u0434\u0430\u044e\u0442 \u0430\u0434\u043c\u0438\u043d\u044b \u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0432 \u0446\u0435\u043b\u043e\u043c<\/strong>. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435, \u0447\u0442\u043e \u0432 \u0432\u0430\u0448\u0435\u043c GreenPlum 250 \u0422\u0431 \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 20 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0437\u0430\u043f\u0443\u0441\u0442\u044f\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432 \u0441\u0440\u0435\u0434\u043d\u0435\u043c \u043d\u0430\u0433\u0435\u043d\u0435\u0440\u0438\u0442 2,5 \u0422\u0431 \u0441\u043f\u0438\u043b\u043b\u043e\u0432, \u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u043e\u043a\u043e\u043b\u043e 1\/6 (50 \u0422\u0431) \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0437\u0430\u043d\u044f\u0442\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u043d\u0430 \u043e\u0434\u0438\u043d \u0440\u0430\u0437, \u0430 \u0432\u0435\u0434\u044c \u044d\u0442\u043e \u043c\u0435\u0441\u0442\u043e \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0435. \u0418 \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0441\u0442\u0430\u043d\u0443\u0442\u0441\u044f, \u0442\u043e \u043d\u0430\u0447\u043d\u0443\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e.<\/p>\n<p>\u0412 \u0438\u0434\u0435\u0430\u043b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u043f\u0438\u043b\u043b\u043e\u0432, \u043d\u043e \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0438\u0445 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u044a\u0435\u043c. \u0421\u043f\u0438\u043b\u043b\u044b \u0441\u0430\u043c\u0438 \u043f\u043e \u0441\u0435\u0431\u0435 \u043d\u0435 \u0437\u043b\u043e, \u0430 \u0433\u0438\u0431\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u043e\u0431\u044a\u0435\u043c\u0443 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0417\u043b\u043e \u2014 \u043a\u043e\u0433\u0434\u0430 \u0438\u0445 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0435 \u0437\u043b\u043e \u2014 \u043a\u043e\u0433\u0434\u0430 \u0438\u0445 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u043c GreenPlum.<\/p>\n<h2>\u041e\u0442\u043b\u043e\u0432 \u0438 \u043f\u043e\u0434\u0441\u0447\u0435\u0442 \u0441\u043f\u0438\u043b\u043b\u043e\u0432<\/h2>\n<p>\u0423\u0437\u043d\u0430\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0447\u043d\u043e \u0441\u043f\u0438\u043b\u043b\u043e\u0432 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441, \u043d\u0435\u043b\u044c\u0437\u044f. \u041c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043b\u0438\u0448\u044c \u043e\u0431\u044a\u0435\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u043f\u0438\u043b\u043b\u043e\u0432 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 EXPLAIN ANALYZE.<\/p>\n<p><strong>\u0421\u043f\u043e\u0441\u043e\u0431 \u2116 1. \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b gp_toolkit.gp_workfile_usage_per_query<\/strong><\/p>\n<p>\u0412 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435: \u043a\u0442\u043e, \u043a\u0430\u043a\u0438\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0438 \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u043f\u0438\u043b\u043b\u043e\u0432 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0435.<\/p>\n<p>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u044d\u0442\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u0432 \u0446\u0435\u043b\u044f\u0445 \u0441\u0430\u043c\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0410\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430\u043c \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u0434\u043b\u044f \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u0441\u043f\u0438\u043b\u043b\u043e\u0432, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0442\u0430\u043a\u0438\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043d\u0430\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442 \u0447\u0440\u0435\u0437\u043c\u0435\u0440\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u043b\u043b\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u0438 \u0443\u0431\u0438\u0432\u0430\u0442\u044c \u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043e\u0431\u044a\u0435\u043c \u0441\u043f\u0438\u043b\u043b\u043e\u0432 \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u0448\u0442\u0440\u0430\u0444\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c gp_toolkit.gp_workfile_usage_per_query. \u0422\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438 \u043e\u0431\u044a\u0435\u043c \u0432 \u0413\u0431 \u0441\u043f\u0438\u043b\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u044b\u043b\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432\u0430\u0448\u0438\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<pre><code class=\"sql\">select   current_query   ,sum(size) \/ 1024 \/ 1024 \/ 1024 :: float size_spill_files_gb   ,sum(numfiles) count_spill_files from   gp_toolkit.gp_workfile_usage_per_query where   usename = current_user group by   current_query<\/code><\/pre>\n<p><strong>\u041f\u043b\u044e\u0441\u044b<\/strong><\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u0447\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u0441\u043f\u0438\u043b\u043b\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u0438\u043d\u0443\u0441\u044b<\/strong><\/p>\n<ul>\n<li>\n<p>\u041f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043c \u043b\u0438\u0448\u044c \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043f\u0438\u043b\u043b\u044b \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0430 \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 gp_toolkit.gp_workfile_usage_per_query \u0437\u0430\u043f\u0443\u0449\u0435\u043d \u0432\u043d\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043e\u0447\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434, \u0447\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043f\u0438\u043b\u043b\u044b.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435\u043b\u044c\u0437\u044f \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u0421\u043f\u043e\u0441\u043e\u0431 \u2116 2. \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <em>EXPLAIN ANALYZE<\/em>\u00a0<\/strong><\/p>\n<p>\u0420\u0430\u0431\u043e\u0442\u0443 \u0441 EXPLAIN ANALYZE \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440. \u0418\u043c\u0435\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043f\u0438\u043b\u043b\u044b:<\/p>\n<pre><code class=\"sql\">select   aef.name   ,aef.value   ,aef.id   ,a.* from   prod_wrk.applications_extra_fields as aef   left join prod_wrk.applications as a     on aef.id = a.id<\/code><\/pre>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 EXPLAIN ANALYZE, \u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c gp_toolkit.gp_workfile_usage_per_query. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 \u0441\u043f\u0430\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 gp_toolkit.gp_workfile_usage_per_query \u0432\u044b\u044f\u0441\u043d\u044f\u0435\u043c, \u0447\u0442\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0431\u044b\u043b\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043e\u043a\u043e\u043b\u043e 344 \u0413\u0431 \u0441\u043f\u0438\u043b\u043b\u043e\u0432:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0438\u0437\u0443\u0447\u0438\u043c \u043f\u043b\u0430\u043d \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u0442 EXPLAIN ANALYZE, \u0441\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u0441\u044f \u0432 \u0441\u0430\u043c\u044b\u0439 \u043d\u0438\u0437, \u0432 \u0441\u0435\u043a\u0446\u0438\u044e Slice statistic. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u043b\u0430\u0439\u0441 \u2116 1:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u0441\u043b\u0430\u0439\u0441 \u043f\u043e\u043c\u0435\u0447\u0435\u043d \u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u043e\u0439 *, \u0437\u043d\u0430\u0447\u0438\u0442, \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u043f\u0438\u043b\u043b-\u0444\u0430\u0439\u043b\u043e\u0432. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u043f\u0438\u043b\u043b\u043e\u0432 \u043e\u0434\u043d\u0438\u043c \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0432\u043e\u0437\u043b\u0435 bytes wanted. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043e 4 014 945 \u041a\u0431, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 3,82 \u0413\u0431, \u0430 \u0442\u0430\u043a \u043a\u0430\u043a \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u0443 \u043d\u0430\u0441 144, \u0442\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u044a\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 550 \u0413\u0431. \u0415\u0441\u043b\u0438 \u0441\u043b\u0430\u0439\u0441\u043e\u0432 \u0441\u043e \u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u043e\u0439 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f bytes wanted. \u0417\u0430 \u0441\u0447\u0435\u0442 \u0441\u043b\u0430\u0439\u0441\u043e\u0432 \u0441\u043e \u0437\u0432\u0435\u0437\u0434\u043e\u0447\u043a\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0438\u0437-\u0437\u0430 \u043a\u0430\u043a\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u043f\u0438\u043b\u043b\u043e\u0432. \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e, \u0435\u0441\u043b\u0438 \u0434\u0436\u043e\u0439\u043d\u043e\u0432 \u0443 \u0432\u0430\u0441 \u0431\u043e\u043b\u044c\u0448\u0435 \u0434\u0432\u0443\u0445.<\/p>\n<p>\u0421\u043f\u043e\u0441\u043e\u0431 \u2116 1 \u043d\u0430\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u043e\u0431\u044a\u0435\u043c \u0441\u043f\u0438\u043b\u043b\u043e\u0432 344 \u0413\u0431, \u0430 \u043f\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0443 \u2116 2 \u2014\u00a0550 \u0413\u0431. \u041f\u043e\u0447\u0435\u043c\u0443 \u0436\u0435 \u0442\u0430\u043a? \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e EXPLAIN ANALYZE \u0434\u0435\u043b\u0430\u0435\u0442 \u043b\u0438\u0448\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u0443\u044e \u043e\u0446\u0435\u043d\u043a\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u0432\u0442\u043e\u0440\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u044c \u043a\u0430\u043a \u043d\u0438\u0436\u043d\u044e\u044e \u043e\u0446\u0435\u043d\u043a\u0443 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043c\u0430 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0443\u043c 550 \u0413\u0431 \u0441\u043f\u0438\u043b\u043b-\u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<p><strong>\u041f\u043b\u044e\u0441\u044b<\/strong><\/p>\n<ul>\n<li>\n<p>\u041c\u043e\u0436\u043d\u043e \u0441 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435.<\/p>\n<\/li>\n<\/ul>\n<p><strong>\u041c\u0438\u043d\u0443\u0441\u044b<\/strong><\/p>\n<ul>\n<li>\n<p>EXPLAIN ANALYZE \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u0443\u0436\u0430\u0441\u043d\u044b\u0439 \u0438 \u0443\u0431\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438, \u0441\u043f\u043e\u0441\u043e\u0431 \u043d\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043e\u0431\u044a\u0435\u043c \u0441\u043f\u0438\u043b\u043b\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<h2>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 spill-\u0444\u0430\u0439\u043b\u043e\u0432 \u0438 \u0438\u0445 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u043b\u043b\u043e\u0432 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0434\u043d\u0430 \u2014 \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0430 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u0421\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0434\u0435\u0444\u0438\u0446\u0438\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e. \u0412\u043e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0445:<\/p>\n<ul>\n<li>\n<p>\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0435\u0437 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432;<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043c\u0430;<\/p>\n<\/li>\n<li>\n<p>DISTINCT \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043e\u043b\u0435\u0439;<\/p>\n<\/li>\n<li>\n<p>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 ORDER BY.<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0440\u0430\u0437\u0431\u0435\u0440\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0438 \u043e\u0431\u044a\u044f\u0441\u043d\u044e, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0432 \u043d\u0438\u0445 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0442\u044c.<\/p>\n<h2>\u041a\u0435\u0439\u0441 \u2116 1. \u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0435\u0437 \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432<\/h2>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 \u0443\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u043b\u043b\u043e\u0432.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0434\u0436\u043e\u0438\u043d, \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u043e\u043c\u0435\u0449\u0430\u044e\u0442\u0441\u044f \u0432 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u043c\u0435\u0441\u0442\u043e \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u043d\u044b, \u043f\u043e \u0441\u0443\u0442\u0438, \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0437\u0430\u0442\u043e\u043b\u043a\u0430\u0442\u044c \u0432\u0441\u044e \u0432\u0438\u0442\u0440\u0438\u043d\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c. \u041d\u0435 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u043e\u043d\u0430 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u044c. \u0410 \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u0441\u044f, \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043a\u0443\u0434\u0430-\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0434\u0436\u043e\u0438\u043d\u0430, \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u043c\u0435\u0441\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u0445\u0432\u0430\u0442\u0438\u0442\u044c \u2014 \u0438 \u043d\u0430\u0447\u043d\u0435\u0442\u0441\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u043f\u0438\u043b\u043b\u043e\u0432.<\/p>\n<p><strong>\u041a\u0430\u043a \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f<\/strong>. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u043d\u0430 \u0434\u0430\u0442\u044b \u0438 \u0432\u0440\u0435\u043c\u044f. \u041e\u0447\u0435\u043d\u044c \u0441\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0443 \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043e\u0431\u044a\u0435\u043c\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430 \u0432\u0441\u0451 \u0432\u0440\u0435\u043c\u044f. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u0430 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u0430 \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0440\u0435\u043c\u0435\u043d, \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0438, \u0438 \u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u0435 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 UNION ALL. \u0421\u0435\u0440\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043d\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435, \u0447\u0435\u043c \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u0440\u0430\u0437\u043e\u043c.<\/p>\n<h2>\u041a\u0435\u0439\u0441 \u2116 2. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043c\u0430<\/h2>\n<p>\u041e\u0442\u0447\u0430\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u0435\u0439\u0441 \u0441\u0445\u043e\u0436 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u043a\u0435\u0439\u0441\u043e\u043c, \u043e\u0434\u043d\u0430\u043a\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0438 \u043f\u0440\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0442\u0430\u0431\u043b\u0438\u0446.<\/p>\n<p>\u041e\u0431\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c\u044b\u0445 \u0432 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0434\u0432\u0443\u0445 \u0432\u0435\u0449\u0435\u0439: \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u0442\u0440\u043e\u043a \u0438 \u043a\u043e\u043b-\u0432\u0430 \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u043f\u043e\u043b\u0435\u0439.<\/p>\n<p>\u041f\u0440\u0438 INNER JOIN \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u0441\u0442\u0440\u043e\u043a. \u041b\u043e\u0433\u0438\u0447\u043d\u043e, \u0432\u0435\u0434\u044c \u043b\u0443\u0447\u0448\u0435 \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u043c\u0435\u043d\u044c\u0448\u0438\u0439 \u043e\u0431\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u0434\u043d\u0430\u043a\u043e \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0438 LEFT JOIN \u2014 \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0438 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0430\u00a0\u0432\u0441\u0435\u0433\u0434\u0430\u00a0\u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u0430\u0432\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0435\u0435 \u043e\u0431\u044a\u0435\u043c.\u00a0<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0435\u043d\u0430\u0440\u043e\u043a\u043e\u043c \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0443\u044e<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-417465","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/417465","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=417465"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/417465\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=417465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=417465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=417465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}