{"id":487631,"date":"2026-07-17T09:39:42","date_gmt":"2026-07-17T09:39:42","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=487631"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=487631","title":{"rendered":"\u041a\u0430\u043a \u0444\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430 \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 JOIN&#8217;\u044b \u0432 PostgreSQL"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 18 \u0440\u0435\u043b\u0438\u0437\u0430 \u0421\u0423\u0411\u0414 Tantor Postgres \u043c\u044b\u00a0<a href=\"https:\/\/habr.com\/ru\/companies\/tantor\/articles\/1035568\/\">\u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438<\/a>\u00a0\u043e\u0431 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0443 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 Nested Loop \u0438 Hash Join. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0435\u043b\u0438\u0437\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u0430\u043a Nested Loop, \u0442\u0430\u043a \u0438 Hash Join. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043e\u0431 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 &#8212; \u0444\u0438\u043b\u044c\u0442\u0440\u0435 \u0411\u043b\u0443\u043c\u0430.<\/p>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0444\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430 \u0432 SQL?<\/h2>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0411\u043b\u0443\u043c\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043b\u044e\u0431\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0438 \u0432\u0441\u0435 \u043e\u043d\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e:<\/p>\n<blockquote>\n<p><em>\u0424\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430 \u2014 \u044d\u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0443. \u041e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0442\u044c \u0434\u0432\u0430 \u043e\u0442\u0432\u0435\u0442\u0430: \u00ab\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0442\u043e\u0447\u043d\u043e \u043d\u0435\u0442\u00bb \u0438\u043b\u0438 \u00ab\u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0435\u0441\u0442\u044c\u00bb. \u041b\u043e\u0436\u043d\u043e\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b, \u043b\u043e\u0436\u043d\u043e\u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u2014 \u043d\u0435\u0442.<\/em><\/p>\n<\/blockquote>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0430\u0432\u0442\u043e\u0440 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043a \u0444\u043e\u0440\u043c\u0443\u043b\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0445\u0435\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0430 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c &#8212; \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u043a \u0442\u043e\u043c\u0443, \u0437\u0430\u0447\u0435\u043c \u044d\u0442\u0430 \u0448\u0442\u0443\u043a\u0430 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0443\u0436\u043d\u0430 \u0432 \u0421\u0423\u0411\u0414:<\/p>\n<blockquote>\n<p><strong><em>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f JOIN.<\/em><\/strong><em>\u00a0\u0421\u0430\u043c\u043e\u0435 \u0447\u0430\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435. \u041f\u0440\u0438 hash join \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0444\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430 \u043f\u043e \u043a\u043b\u044e\u0447\u0430\u043c \u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0438 \u0438\u043c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043e\u0442\u0441\u0435\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0432\u0435\u0434\u043e\u043c\u043e \u043d\u0435 \u043d\u0430\u0439\u0434\u0443\u0442 \u043f\u0430\u0440\u0443. \u042d\u0442\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u043e\u0431\u044a\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u043e\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0434\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f. \u0412 PostgreSQL \u0442\u0430\u043a\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 hash join, \u0432 SQL Server \u043e\u043d\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f bitmap-\u0444\u0438\u043b\u044c\u0442\u0440\u0430\u043c\u0438, \u0432 Oracle \u2014 bloom filter pruning.<\/em><\/p>\n<\/blockquote>\n<p>\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f, \u044f \u0443\u0436\u0435 \u043e\u0446\u0435\u043d\u0438\u043b \u044d\u0444\u0444\u0435\u043a\u0442 \u043e\u0442 \u044d\u0442\u043e\u0439 \u0444\u0438\u0447\u0438 \u0432\u00a0<a href=\"https:\/\/tantorlabs.ru\/products\/dbms\">Tantor Postgres<\/a>, \u043c\u043e\u0433\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0443 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u043c \u0442\u0435\u043e\u0440\u0438\u044e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c (\u0432\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0438\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 Tantor Postgres 18.4, \u0432 \u0432\u0430\u043d\u0438\u043b\u044c\u043d\u043e\u043c PostgreSQL \u0442\u0430\u043a\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435\u0442):<\/p>\n<pre><code class=\"pgsql\">DROP TABLE IF EXISTS orders, active_customers; CREATE TABLE orders (    order_id    int,    customer_id int); -- 10 \u043c\u043b\u043d \u0437\u0430\u043a\u0430\u0437\u043e\u0432, customer_id \u0438\u0437 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 1..10_000_000INSERT INTO ordersSELECT g, (random() * 10000000)::int + 1FROM generate_series(1, 10000000) g; CREATE TABLE active_customers (customer_id int);INSERT INTO active_customersSELECT generate_series(1, 100000);   -- 1% \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043a\u043b\u044e\u0447\u0435\u0439 ANALYZE active_customers;ANALYZE orders;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u044d\u0442\u0438 \u0434\u0432\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u043e \u043f\u043e\u043b\u044e\u00a0<code>customer_id.\u00a0<\/code>\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442 \u043f\u0440\u0438 \u043e\u0434\u043d\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438, &#8212; \u0442\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e:<\/p>\n<pre><code class=\"pgsql\">SET max_parallel_workers_per_gather = 0;SET enable_hashjoin_bloom = off; explain (analyze, verbose, buffers off, costs off)SELECT o.*FROM orders oJOIN active_customers c ON o.customer_id = c.customer_id;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u043b\u0430\u043d:<\/p>\n<pre><code class=\"pgsql\">\"Hash Join (actual time=17.580..1719.505 rows=100053.00 loops=1)\"\"  Hash Cond: (o.customer_id = c.customer_id)\"\"  -&gt;  Seq Scan on public.orders o (actual time=0.025..602.263 rows=10000000.00 loops=1)\"\"  -&gt;  Hash (actual time=17.334..17.337 rows=100000.00 loops=1)\"\"        Buckets: 131072  Batches: 1  Memory Usage: 4540kB\"\"        -&gt;  Seq Scan on public.active_customers c (actual time=0.013..7.712 rows=100000.00 loops=1)\"<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041d\u0430 \u0443\u0437\u0435\u043b\u00a0<code>Hash Join<\/code>\u00a0\u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0434\u0432\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b: \u0432\u00a0<code>active_customers<\/code>\u00a0100 \u0442\u044b\u0441. \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0430 \u0432\u00a0<code>orders<\/code>\u00a0&#8212; 10 \u043c\u043b\u043d. \u041d\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0445\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u0442\u0430\u0431\u043b\u0438\u0446 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<br \/>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0442\u043e\u0442 \u0436\u0435 \u0437\u0430\u043f\u0440\u043e\u0441, \u0432\u043a\u043b\u044e\u0447\u0438\u0432 bloom-\u0444\u0438\u043b\u044c\u0442\u0440 (<code>enable_hashjoin_bloom=on<\/code>):<\/p>\n<pre><code class=\"pgsql\">\"Hash Join (actual time=26.034..878.077 rows=100053.00 loops=1)\"\"  Hash Cond: (o.customer_id = c.customer_id)\"\"  -&gt;  Seq Scan on public.orders o (actual time=0.034..806.095 rows=100286.00 loops=1)\"\"        Bloom Filter 1: keys=(o.customer_id) checked=9999999 rejected=9899714 (99.0%)\"\"  -&gt;  Hash (actual time=25.537..25.538 rows=100000.00 loops=1)\"\"        Buckets: 131072  Batches: 1  Memory Usage: 4540kB\"\"        Bloom Filter 1: bits=8388608 hashes=10 memory=1024kB checked=9999999 rejected=9899714\"\"        -&gt;  Seq Scan on public.active_customers c (actual time=0.014..12.260 rows=100000.00 loops=1)\"<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412 \u043f\u043b\u0430\u043d\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u043e\u0432\u0430\u044f \u0441\u0435\u043a\u0446\u0438\u044f\u00a0<code>Bloom Filter<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u0431\u044b\u043b \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d. \u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043f\u043e \u0448\u0430\u0433\u0430\u043c, \u0447\u0442\u043e \u0436\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u043b bloom-\u0444\u0438\u043b\u044c\u0442\u0440, \u0438 \u0447\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u0441\u043b\u0435 \u0435\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p><strong>\u0428\u0430\u0433 1. \u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0430.<\/strong><\/p>\n<p>\u041d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0445\u0435\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u044b (\u0443\u0437\u0435\u043b\u00a0<code>Hash<\/code>) Tantor Postgres \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0433\u043d\u0430\u043b \u0432\u0441\u0435 100 \u0442\u044b\u0441. \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439\u00a0<code>customer_id<\/code>\u00a0\u0438\u0437\u00a0<code>active_customers<\/code>\u00a0\u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0431\u043e\u0440 \u0445\u0435\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u043b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0431\u0438\u0442\u044b \u0432 \u0431\u0438\u0442\u043e\u0432\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0432\u0438\u0434\u043d\u044b \u043f\u0440\u044f\u043c\u043e \u0432 \u043f\u043b\u0430\u043d\u0435:<\/p>\n<pre><code class=\"pgsql\">Bloom Filter 1: bits=8388608 hashes=10 memory=1024kB<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0430 8,4 \u043c\u043b\u043d \u0431\u0438\u0442 (1 \u041c\u0411 \u043f\u0430\u043c\u044f\u0442\u0438), \u043a\u0430\u0436\u0434\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u0441\u044f\u0442\u044c\u044e\u00a0\u0445\u0435\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438. \u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0441\u0442\u043e\u0438\u043b\u043e \u043d\u0430\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438: \u0443\u0437\u0435\u043b\u00a0<code>Hash<\/code>\u00a0\u0437\u0430\u043c\u0435\u0434\u043b\u0438\u043b\u0441\u044f \u0441 17,3 \u0434\u043e 25,5 \u043c\u0441. \u042d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0446\u0435\u043d\u0430 \u0444\u0438\u0447\u0438 &#8212; \u043f\u043b\u0430\u0442\u0430 \u0437\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435.<\/p>\n<p><strong>\u0428\u0430\u0433 2. \u041f\u0440\u043e\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043d\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432\u043d\u0438\u0437 (pushdown).<\/strong><\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\u00a0<code>o.customer_id = c.customer_id<\/code>\u00a0\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0443\u0437\u043b\u0435\u00a0<code>Hash Join<\/code>\u00a0&#8212; \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u0441\u0435 10 \u043c\u043b\u043d \u0441\u0442\u0440\u043e\u043a\u00a0<code>orders<\/code>\u00a0\u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0435\u0445\u0430\u0442\u044c \u043e\u0442\u00a0<code>Seq Scan<\/code>\u00a0\u0434\u043e\u00a0<code>Hash Join<\/code>, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043c \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u0441\u044f, \u0447\u0442\u043e 99% \u0438\u0437 \u043d\u0438\u0445 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b.<\/p>\n<p>Bloom-\u0444\u0438\u043b\u044c\u0442\u0440 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u044d\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0440\u0430\u043d\u044c\u0448\u0435 &#8212; \u043f\u0440\u044f\u043c\u043e \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u00a0<code>orders<\/code>. \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043b\u0430\u043d:<\/p>\n<pre><code class=\"pgsql\">-&gt; Seq Scan on public.orders o (actual time=0.034..806.095 rows=100286.00 loops=1)     Bloom Filter 1: keys=(o.customer_id) checked=9999999 rejected=9899714 (99.0%)<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0421\u0442\u0440\u043e\u043a\u0430\u00a0<code>Bloom Filter<\/code>\u00a0\u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043d\u0443\u0442\u0440\u0438\u00a0<code>Seq Scan<\/code>. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 10 \u043c\u043b\u043d \u043f\u0440\u043e\u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a (<code>checked=9999999<\/code>) \u0444\u0438\u043b\u044c\u0442\u0440 \u043e\u0442\u0432\u0435\u0447\u0430\u043b \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u00ab\u0430 \u0435\u0441\u0442\u044c \u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0430\u043a\u043e\u0439 customer_id \u0441\u0440\u0435\u0434\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432?\u00bb. \u0412 9 899 714 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043e\u0442\u0432\u0435\u0442 \u0431\u044b\u043b \u00ab\u0442\u043e\u0447\u043d\u043e \u043d\u0435\u0442\u00bb (<code>rejected<\/code>), \u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043b\u0430\u0441\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0430 \u0443\u0437\u043b\u0435 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b\u00a0<code>orders<\/code>.<\/p>\n<p>\u0412\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0443\u0437\u043b\u0430 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u043e\u0441\u044c \u0441 602 \u0434\u043e 806 \u043c\u0441 &#8212; \u044d\u0442\u043e \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 bloom-\u0444\u0438\u043b\u044c\u0442\u0440\u0430.<\/p>\n<p><strong>\u0428\u0430\u0433 3. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/strong><\/p>\n<p>\u0418\u0437\u00a0<code>Seq Scan<\/code>\u00a0\u043d\u0430\u0432\u0435\u0440\u0445, \u043a\u00a0<code>Hash Join<\/code>, \u0432\u044b\u0448\u043b\u043e \u043d\u0435 10 \u043c\u043b\u043d \u0441\u0442\u0440\u043e\u043a, \u0430 \u0432\u0441\u0435\u0433\u043e 100 286 (<code>rows=100286.00<\/code>). \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0434\u043e\u0448\u043b\u0438 \u0434\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\u00a0<code>Hash Join<\/code>.<\/p>\n<p>\u041e\u0442\u043a\u0443\u0434\u0430 \u0432\u0437\u044f\u043b\u0438\u0441\u044c \u043b\u0438\u0448\u043d\u0438\u0435 233 \u0441\u0442\u0440\u043e\u043a\u0438? \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 &#8212; 100 053 \u0441\u0442\u0440\u043e\u043a\u0438, \u0430 \u0444\u0438\u043b\u044c\u0442\u0440 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b 100 286. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 233 \u0441\u0442\u0440\u043e\u043a\u0438 &#8212; \u044d\u0442\u043e \u043b\u043e\u0436\u043d\u043e\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f: \u0434\u043b\u044f \u043d\u0438\u0445 \u0432\u0441\u0435 \u0434\u0435\u0441\u044f\u0442\u044c \u0431\u0438\u0442\u043e\u0432 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0438 \u0444\u0438\u043b\u044c\u0442\u0440 \u0441\u043a\u0430\u0437\u0430\u043b \u00ab\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0435\u0441\u0442\u044c\u00bb. \u041e\u0448\u0438\u0431\u043a\u0438 \u044d\u0442\u043e \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442: \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043d\u0430\u0439\u0434\u0443\u0442 \u043f\u0430\u0440\u0443 \u0432 \u0445\u0435\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0438 \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0431\u0440\u043e\u0448\u0435\u043d\u044b \u0443\u0436\u0435 \u043d\u0430 \u0443\u0437\u043b\u0435\u00a0<code>Hash Join<\/code>. \u0424\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u0448\u0438\u0431\u0438\u0442\u044c\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443: \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043e\u043d \u043d\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c.<\/p>\n<p>\u0421\u0440\u0430\u0432\u043d\u0438\u043c \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u043e\u0432 \u043f\u043b\u0430\u043d\u0430:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"left\"><strong>\u0423\u0437\u0435\u043b<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>Bloom off<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>Bloom on<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Seq Scan on orders<\/p>\n<\/td>\n<td>\n<p align=\"left\">602<\/p>\n<\/td>\n<td>\n<p align=\"left\">806<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Hash<\/p>\n<\/td>\n<td>\n<p align=\"left\">17<\/p>\n<\/td>\n<td>\n<p align=\"left\">25<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Hash Join<\/p>\n<\/td>\n<td>\n<p align=\"left\">1099<\/p>\n<\/td>\n<td>\n<p align=\"left\">46<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u0417\u0430\u043f\u0440\u043e\u0441 \u0446\u0435\u043b\u0438\u043a\u043e\u043c<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>1719<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>878<\/strong><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u0437\u0430\u043f\u0440\u043e\u0441 \u0443\u0441\u043a\u043e\u0440\u0438\u043b\u0441\u044f \u0432\u0434\u0432\u043e\u0435 \u0438\u0437-\u0437\u0430 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u0430\u043c\u043e\u0439 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0435\u043c\u043a\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 &#8212; Hash Join.<\/p>\n<p>\u0410 \u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 bloom-\u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0445\u0443\u0436\u0435? \u0414\u0430, \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0437\u0430\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u0435\u0433\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u043c\u043f\u0435\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438\u00a0<code>Hash Join<\/code>. \u0421\u044d\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439:<\/p>\n<pre><code class=\"bash\">TRUNCATE active_customers;INSERT INTO active_customersSELECT generate_series(1, 9500000);  -- 95% \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043a\u043b\u044e\u0447\u0435\u0439<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 bloom-\u0444\u0438\u043b\u044c\u0442\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u0438\u043d\u0443\u0442\u044c \u043d\u0435 99% \u0441\u0442\u0440\u043e\u043a \u043a\u0430\u043a \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435, \u0430 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c 5%, \u0442.\u043a. \u043f\u043e\u0447\u0442\u0438 \u043a\u0430\u0436\u0434\u044b\u0439\u00a0<code>customer_id<\/code>\u00a0\u0438\u0437\u00a0<code>orders<\/code>\u00a0\u043d\u0430\u0439\u0434\u0435\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b\u00a0<code>active_customers<\/code>.<\/p>\n<p><code>enable_hashjoin_bloom = off<\/code>:<\/p>\n<pre><code class=\"pgsql\">\"Hash Join (actual time=3686.180..10541.744 rows=9499724.00 loops=1)\"\"  Hash Cond: (c.customer_id = o.customer_id)\"\"  -&gt;  Seq Scan on public.active_customers c (actual time=0.063..613.167 rows=9500000.00 loops=1)\"\"  -&gt;  Hash (actual time=3581.865..3581.872 rows=10000000.00 loops=1)\"\"        Buckets: 16777216  Batches: 1  Memory Usage: 521697kB\"\"        -&gt;  Seq Scan on public.orders o (actual time=0.053..700.691 rows=10000000.00 loops=1)\"<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><code>enable_hashjoin_bloom = on<\/code>:<\/p>\n<pre><code class=\"pgsql\">\"Hash Join (actual time=5414.793..12388.729 rows=9499724.00 loops=1)\"\"  Hash Cond: (o.customer_id = c.customer_id)\"\"  -&gt;  Seq Scan on public.orders o (actual time=0.034..741.536 rows=9995087.00 loops=1)\"\"        Bloom Filter 1: keys=(o.customer_id) checked=100989 rejected=4913 (4.9%)\"\"  -&gt;  Hash (actual time=5321.682..5321.684 rows=9500000.00 loops=1)\"\"        Buckets: 16777216  Batches: 1  Memory Usage: 465057kB\"\"        Bloom Filter 1: bits=134217728 hashes=10 memory=16384kB checked=100989 rejected=4913\"\"        -&gt;  Seq Scan on public.active_customers c (actual time=0.064..670.680 rows=9500000.00 loops=1)\"<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043b\u0430\u043d, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u044b\u00a0<code>active_costumers<\/code>\u00a0\u0438\u00a0<code>orders<\/code>\u00a0\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u043f\u0440\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445\u00a0<code>enable_hashjoin_bloom<\/code>. \u0414\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0443\u0437\u043b\u043e\u0432 \u044d\u0442\u043e \u043d\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e, \u0442.\u043a. \u043e\u0431\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439.<\/p>\n<p>\u0421\u0440\u0430\u0432\u043d\u0438\u043c \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u043e\u0432 \u043f\u043b\u0430\u043d\u0430:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p><strong>\u0423\u0437\u0435\u043b<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>Bloom off<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>Bloom on<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Seq Scan on orders<\/p>\n<\/td>\n<td>\n<p align=\"left\">613<\/p>\n<\/td>\n<td>\n<p align=\"left\">741<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Hash<\/p>\n<\/td>\n<td>\n<p align=\"left\">3 581<\/p>\n<\/td>\n<td>\n<p align=\"left\">5 321<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Hash Join<\/p>\n<\/td>\n<td>\n<p align=\"left\">6 346<\/p>\n<\/td>\n<td>\n<p align=\"left\">6 325<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u0417\u0430\u043f\u0440\u043e\u0441 \u0446\u0435\u043b\u0438\u043a\u043e\u043c<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>10 541<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>12 388<\/strong><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u043e\u0441\u044c \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0443\u0437\u043b\u0430\u00a0<code>Hash<\/code>, \u0442.\u043a. \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0445\u0435\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u043c\u0435\u0441\u0442\u043e 100 \u0442\u044b\u0441. \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0431\u043e\u0440 \u0445\u0435\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 bloom-\u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u044e\u0442\u0441\u044f 9.5 \u043c\u043b\u043d \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u0433\u043e bloom-\u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438\u00a0<code>Seq Scan on orders<\/code>\u00a0\u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u044e \u0432\u0441\u0435\u0433\u043e 4.9% \u0441\u0442\u0440\u043e\u043a (<code>rejected=4913<\/code>), \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u0441\u0435\u0433\u043e 100 \u0442\u044b\u0441\u044f\u0447 \u0441\u0442\u0440\u043e\u043a \u0438\u0437 10 \u043c\u043b\u043d (<code>checked=100989<\/code>). \u041f\u043e\u0447\u0435\u043c\u0443? \u0414\u0435\u043b\u043e \u0432 \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u043e\u043c \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430: \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c \u0441\u043b\u0435\u0434\u0438\u0442 \u0437\u0430 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c\u044e \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043d\u0430 \u043b\u0435\u0442\u0443, \u0438 \u0435\u0441\u043b\u0438 \u0442\u043e\u0442 \u043d\u0435 \u043e\u043f\u0440\u0430\u0432\u0434\u044b\u0432\u0430\u0435\u0442 \u0441\u0435\u0431\u044f, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c. \u0410 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0443\u0437\u043b\u0430\u00a0<code>Hash Join<\/code>\u00a0\u043f\u043e\u0447\u0442\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e, \u0442.\u043a. \u0435\u043c\u0443 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0438\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u044b\u0442\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u0431\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432\u043e\u0437\u0440\u043e\u0441\u043b\u043e \u043d\u0430 15% \u0438\u0437-\u0437\u0430 \u0437\u0430\u0442\u0440\u0430\u0442 \u043d\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 bloom-\u0444\u0438\u043b\u044c\u0442\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b \u043d\u0430 \u043b\u0435\u0442\u0443 \u0438\u0437-\u0437\u0430 \u0435\u0433\u043e \u043d\u0438\u0437\u043a\u043e\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h2>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445<\/h2>\n<p>\u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 1\u0421 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0435 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b,\u00a0\u043d\u0430 \u043d\u0435\u0439 \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0439\u0442\u0438\u00a0\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0447\u0442\u0438 \u043b\u044e\u0431\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.<\/p>\n<p>\u0412 1\u0421:ERP \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043a\u0430\u043a \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u043c\u0435\u0441\u044f\u0446\u0430, \u0438 \u0432 \u0445\u043e\u0434\u0435 \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u043f\u043e\u0434 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f bloom-\u0444\u0438\u043b\u044c\u0442\u0440\u0430, \u0442.\u043a. \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u0442\u044b\u0441\u044f\u0447\u0430\u043c\u0438 \u0438 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0430\u043c\u0438 \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u0412\u043e\u0442 \u043e\u0434\u0438\u043d \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b bloom-\u0444\u0438\u043b\u044c\u0442\u0440:<\/p>\n<p>off &#8212;\u00a0<a href=\"https:\/\/explain.tensor.ru\/archive\/explain\/6f12119c3ff724f469d3f23c0a9fd261:0:2026-06-29\">https:\/\/explain.tensor.ru\/archive\/explain\/6f12119c3ff724f469d3f23c0a9fd261:0:2026-06-29<\/a><\/p>\n<p>on &#8212;\u00a0<a href=\"https:\/\/explain.tensor.ru\/archive\/explain\/80a5edf9096f374dcb3d6b4699450891:0:2026-06-29\">https:\/\/explain.tensor.ru\/archive\/explain\/80a5edf9096f374dcb3d6b4699450891:0:2026-06-29<\/a><\/p>\n<p>\u0412\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0443\u0437\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442 bloom-\u0444\u0438\u043b\u044c\u0442\u0440:<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0e9\/768\/99f\/0e976899f4199b2ee89032ed273681da.png\" width=\"1497\" height=\"704\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/0e9\/768\/99f\/0e976899f4199b2ee89032ed273681da.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0e9\/768\/99f\/0e976899f4199b2ee89032ed273681da.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0443 \u043d\u0430\u0441 \u0443\u0441\u043a\u043e\u0440\u044f\u044e\u0442\u0441\u044f \u0442\u0440\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445\u00a0<code>Hash Join<\/code>\u00a0\u0437\u0430 \u0441\u0447\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0438\u0434\u0443\u044e\u0449\u0438\u0445 \u043a \u043d\u0438\u043c \u043d\u0430 \u0432\u0445\u043e\u0434, \u0438 \u0441\u0430\u043c \u0443\u0437\u0435\u043b\u00a0<code>Seq Scan<\/code>\u00a0\u0442\u043e\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0442\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u0441 40 \u0434\u043e 15 \u0441\u0435\u043a\u0443\u043d\u0434.<\/p>\n<p>\u0412\u0437\u0433\u043b\u044f\u043d\u0435\u043c \u043d\u0430 \u0447\u0430\u0441\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d \u0432\u044b\u0448\u0435:<\/p>\n<pre><code class=\"bash\">FROM _AccumRg127724 T17LEFT OUTER JOIN _Reference181 T18ON (T17._Fld127725RRef = T18._IDRRef) AND (T18._Fld1551 = CAST(0 AS NUMERIC))LEFT OUTER JOIN _Reference230 T19ON (T18._Fld4875RRef = T19._IDRRef) AND (T19._Fld1551 = CAST(0 AS NUMERIC))WHERE ((T17._Fld1551 = CAST(0 AS NUMERIC))) AND (T17._Period &gt; '2018-03-31 23:59:59'::timestamp AND T17._Period &lt; '3999-11-01 00:00:00'::timestamp AND T17._Active = TRUE AND (T17._Fld127725RRef IN(SELECTT20._Q_001_F_000RRef AS Q_001_F_000RRefFROM pg_temp.tt50 T20) AND ((T17._Fld127727RRef &lt;&gt; '\\2646\\000\\025\\351\/(\\002\\021\\337r\\017\\234UmM'::bytea) OR (T17._Fld127727RRef &lt;&gt; T19._Fld155113RRef)))<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u0440\u0438\u00a0<code>enable_hashjoin_bloom = off<\/code>\u00a0\u0442\u0430\u0431\u043b\u0438\u0446\u0430 T17 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0435\u0442\u0441\u044f \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 T18, T19, T20. \u041f\u0440\u0438\u00a0<code>enable_hashjoin_bloom = on\u00a0<\/code>\u043f\u0440\u0438 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b T17 bloom-\u0444\u0438\u043b\u044c\u0442\u0440 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b T20, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0435\u0437 bloom-\u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u043b\u0441\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 T20 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 T18 \u0438T19 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0441\u043e\u043a\u0440\u0430\u0449\u0430\u0435\u0442. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 bloom-\u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u043d\u043d\u0435\u043c \u044d\u0442\u0430\u043f\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u0435\u043b\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043e\u0442\u0431\u043e\u0440, \u0447\u0435\u0433\u043e \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043d\u0435 \u0434\u0435\u043b\u0430\u043b.<\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u043c\u0430\u0441\u0441\u043e\u0432\u044b\u0439 &#8212; \u044d\u0442\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0447\u0435\u0442\u0430 \u043f\u043e \u0437\u0430\u043a\u0430\u0437\u0430\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0432 1\u0421:ERP.<\/p>\n<p>Bloom-\u0444\u0438\u043b\u044c\u0442\u0440:<\/p>\n<p>off &#8212;\u00a0<a href=\"https:\/\/explain.tensor.ru\/archive\/explain\/f8f8866673696b803666eb4cde1f9dd5:0:2026-07-12\">https:\/\/explain.tensor.ru\/archive\/explain\/f8f8866673696b803666eb4cde1f9dd5:0:2026-07-12<\/a><\/p>\n<p>on &#8212;\u00a0<a href=\"https:\/\/explain.tensor.ru\/archive\/explain\/9fc24890d53f211fa83be2b4ce887fc0:0:2026-07-12\">https:\/\/explain.tensor.ru\/archive\/explain\/9fc24890d53f211fa83be2b4ce887fc0:0:2026-07-12<\/a><\/p>\n<p>\u042d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u0441\u0438\u043d\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0442\u043e\u0440\u044b \u043c\u044b \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0438 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438: \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0442\u0430\u0431\u043b\u0438\u0446, \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f bloom-\u0444\u0438\u043b\u044c\u0442\u0440 \u043f\u043e \u043c\u0435\u043d\u044c\u0448\u0435\u0439 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446, \u0438 \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043a \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0441\u0442\u0440\u043e\u043a (\u043f\u043e\u0447\u0442\u0438 100%):<\/p>\n<figure class=\"full-width \"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9f9\/e88\/c01\/9f9e88c01e3604468f73c139b6b17cde.png\" width=\"1841\" height=\"396\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/9f9\/e88\/c01\/9f9e88c01e3604468f73c139b6b17cde.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9f9\/e88\/c01\/9f9e88c01e3604468f73c139b6b17cde.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u0417\u0430\u043f\u0440\u043e\u0441 \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442\u0441\u044f \u0441 1200 \u0434\u043e 700 \u043c\u0441.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0420\u0430\u0437\u0432\u0438\u0442\u0438\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 &#8212; \u044d\u0442\u043e \u043d\u0435 \u043f\u043e\u0438\u0441\u043a \u043e\u0434\u043d\u043e\u0439 &#171;\u0432\u043e\u043b\u0448\u0435\u0431\u043d\u043e\u0439&#187; \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0439, \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435. Bloom-\u0444\u0438\u043b\u044c\u0442\u0440 &#8212; \u043e\u0434\u043d\u043e \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0435\u043b\u0438\u0437\u0435 \u0421\u0423\u0411\u0414 Tantor Postgres. \u0417\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0442\u043e\u044f\u0442 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f, \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u0438 \u0442\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430\u0445, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u043e\u0441\u0438\u043b\u0430 \u043f\u043e\u043b\u044c\u0437\u0443 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043c, \u0433\u0434\u0435 \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0438 \u043e \u0434\u0440\u0443\u0433\u0438\u0445 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f\u0445 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u0439\u0434\u0443\u0442 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0430\u0448\u0435\u0439 \u0421\u0423\u0411\u0414.\u00a0<a href=\"https:\/\/habr.com\/ru\/companies\/tantor\/articles\/\">\u041f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0439\u0442\u0435\u0441\u044c<\/a>, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c.<\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1060058\/\">https:\/\/habr.com\/ru\/articles\/1060058\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 18 \u0440\u0435\u043b\u0438\u0437\u0430 \u0421\u0423\u0411\u0414 Tantor Postgres \u043c\u044b\u00a0\u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438\u00a0\u043e\u0431 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0443 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u043c\u0435\u0436\u0434\u0443 Nested Loop \u0438 Hash Join. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0435\u043b\u0438\u0437\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a\u0430\u043a Nested Loop, \u0442\u0430\u043a \u0438 Hash Join. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043e\u0431 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 &#8212; \u0444\u0438\u043b\u044c\u0442\u0440\u0435 \u0411\u043b\u0443\u043c\u0430.\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0444\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430 \u0432 SQL?\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0411\u043b\u0443\u043c\u0430 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432 \u043b\u044e\u0431\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435, \u0438 \u0432\u0441\u0435 \u043e\u043d\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e:\u0424\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430 \u2014 \u044d\u0442\u043e \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u043d\u0430\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0443. \u041e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0442\u044c \u0434\u0432\u0430 \u043e\u0442\u0432\u0435\u0442\u0430: \u00ab\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0442\u043e\u0447\u043d\u043e \u043d\u0435\u0442\u00bb \u0438\u043b\u0438 \u00ab\u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0435\u0441\u0442\u044c\u00bb. \u041b\u043e\u0436\u043d\u043e\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b, \u043b\u043e\u0436\u043d\u043e\u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u2014 \u043d\u0435\u0442.\u041e\u0431\u044b\u0447\u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0430\u0432\u0442\u043e\u0440 \u0441\u0442\u0430\u0442\u044c\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043a \u0444\u043e\u0440\u043c\u0443\u043b\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0445\u0435\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0430 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c &#8212; \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0440\u0430\u0437\u0443 \u043a \u0442\u043e\u043c\u0443, \u0437\u0430\u0447\u0435\u043c \u044d\u0442\u0430 \u0448\u0442\u0443\u043a\u0430 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0443\u0436\u043d\u0430 \u0432 \u0421\u0423\u0411\u0414:\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f JOIN.\u00a0\u0421\u0430\u043c\u043e\u0435 \u0447\u0430\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435. \u041f\u0440\u0438 hash join \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0444\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430 \u043f\u043e \u043a\u043b\u044e\u0447\u0430\u043c \u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0438 \u0438\u043c \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043e\u0442\u0441\u0435\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0432\u0435\u0434\u043e\u043c\u043e \u043d\u0435 \u043d\u0430\u0439\u0434\u0443\u0442 \u043f\u0430\u0440\u0443. \u042d\u0442\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u043e\u0431\u044a\u0451\u043c \u0434\u0430\u043d\u043d\u044b\u0445, \u0434\u043e\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0434\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f. \u0412 PostgreSQL \u0442\u0430\u043a\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 hash join, \u0432 SQL Server \u043e\u043d\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f bitmap-\u0444\u0438\u043b\u044c\u0442\u0440\u0430\u043c\u0438, \u0432 Oracle \u2014 bloom filter pruning.\u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b\u0445\u043e\u0434\u0438\u0442 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f, \u044f \u0443\u0436\u0435 \u043e\u0446\u0435\u043d\u0438\u043b \u044d\u0444\u0444\u0435\u043a\u0442 \u043e\u0442 \u044d\u0442\u043e\u0439 \u0444\u0438\u0447\u0438 \u0432\u00a0Tantor Postgres, \u043c\u043e\u0433\u0443 \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u043e\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u0443 \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043e\u0442\u0440\u0430\u0436\u0430\u0435\u0442 \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u043c \u0442\u0435\u043e\u0440\u0438\u044e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c (\u0432\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0438\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 Tantor Postgres 18.4, \u0432 \u0432\u0430\u043d\u0438\u043b\u044c\u043d\u043e\u043c PostgreSQL \u0442\u0430\u043a\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435\u0442):DROP TABLE IF EXISTS orders, active_customers; CREATE TABLE orders (    order_id    int,    customer_id int); &#8212; 10 \u043c\u043b\u043d \u0437\u0430\u043a\u0430\u0437\u043e\u0432, customer_id \u0438\u0437 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 1..10_000_000INSERT INTO ordersSELECT g, (random() * 10000000)::int + 1FROM generate_series(1, 10000000) g; CREATE TABLE active_customers (customer_id int);INSERT INTO active_customersSELECT generate_series(1, 100000);   &#8212; 1% \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043a\u043b\u044e\u0447\u0435\u0439 ANALYZE active_customers;ANALYZE orders;\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u044d\u0442\u0438 \u0434\u0432\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u043e \u043f\u043e\u043b\u044e\u00a0customer_id.\u00a0\u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442 \u043f\u0440\u0438 \u043e\u0434\u043d\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438, &#8212; \u0442\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e:SET max_parallel_workers_per_gather = 0;SET enable_hashjoin_bloom = off; explain (analyze, verbose, buffers off, costs off)SELECT o.*FROM orders oJOIN active_customers c ON o.customer_id = c.customer_id;\u041f\u043b\u0430\u043d:&#187;Hash Join (actual time=17.580..1719.505 rows=100053.00 loops=1)&#187;&#187;  Hash Cond: (o.customer_id = c.customer_id)&#187;&#187;  -&gt;  Seq Scan on public.orders o (actual time=0.025..602.263 rows=10000000.00 loops=1)&#187;&#187;  -&gt;  Hash (actual time=17.334..17.337 rows=100000.00 loops=1)&#187;&#187;        Buckets: 131072  Batches: 1  Memory Usage: 4540kB&#187;&#187;        -&gt;  Seq Scan on public.active_customers c (actual time=0.013..7.712 rows=100000.00 loops=1)&#187;\u041d\u0430 \u0443\u0437\u0435\u043b\u00a0Hash Join\u00a0\u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0434\u0432\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b: \u0432\u00a0active_customers\u00a0100 \u0442\u044b\u0441. \u0437\u0430\u043f\u0438\u0441\u0435\u0439, \u0430 \u0432\u00a0orders\u00a0&#8212; 10 \u043c\u043b\u043d. \u041d\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u0445\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u0442\u0430\u0431\u043b\u0438\u0446 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430.\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0442\u043e\u0442 \u0436\u0435 \u0437\u0430\u043f\u0440\u043e\u0441, \u0432\u043a\u043b\u044e\u0447\u0438\u0432 bloom-\u0444\u0438\u043b\u044c\u0442\u0440 (enable_hashjoin_bloom=on):&#187;Hash Join (actual time=26.034..878.077 rows=100053.00 loops=1)&#187;&#187;  Hash Cond: (o.customer_id = c.customer_id)&#187;&#187;  -&gt;  Seq Scan on public.orders o (actual time=0.034..806.095 rows=100286.00 loops=1)&#187;&#187;        Bloom Filter 1: keys=(o.customer_id) checked=9999999 rejected=9899714 (99.0%)&#187;&#187;  -&gt;  Hash (actual time=25.537..25.538 rows=100000.00 loops=1)&#187;&#187;        Buckets: 131072  Batches: 1  Memory Usage: 4540kB&#187;&#187;        Bloom Filter 1: bits=8388608 hashes=10 memory=1024kB checked=9999999 rejected=9899714&#8243;&#187;        -&gt;  Seq Scan on public.active_customers c (actual time=0.014..12.260 rows=100000.00 loops=1)&#187;\u0412 \u043f\u043b\u0430\u043d\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u043e\u0432\u0430\u044f \u0441\u0435\u043a\u0446\u0438\u044f\u00a0Bloom Filter, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043d\u0430\u043c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u0431\u044b\u043b \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d. \u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043f\u043e \u0448\u0430\u0433\u0430\u043c, \u0447\u0442\u043e \u0436\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u043b bloom-\u0444\u0438\u043b\u044c\u0442\u0440, \u0438 \u0447\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u0441\u043b\u0435 \u0435\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.\u0428\u0430\u0433 1. \u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0444\u0438\u043b\u044c\u0442\u0440\u0430.\u041d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0445\u0435\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u044b (\u0443\u0437\u0435\u043b\u00a0Hash) Tantor Postgres \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0433\u043d\u0430\u043b \u0432\u0441\u0435 100 \u0442\u044b\u0441. \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439\u00a0customer_id\u00a0\u0438\u0437\u00a0active_customers\u00a0\u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0431\u043e\u0440 \u0445\u0435\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u043b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0431\u0438\u0442\u044b \u0432 \u0431\u0438\u0442\u043e\u0432\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0432\u0438\u0434\u043d\u044b \u043f\u0440\u044f\u043c\u043e \u0432 \u043f\u043b\u0430\u043d\u0435:Bloom Filter 1: bits=8388608 hashes=10 memory=1024kB\u0422\u043e \u0435\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0430 8,4 \u043c\u043b\u043d \u0431\u0438\u0442 (1 \u041c\u0411 \u043f\u0430\u043c\u044f\u0442\u0438), \u043a\u0430\u0436\u0434\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u0441\u044f\u0442\u044c\u044e\u00a0\u0445\u0435\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438. \u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0441\u0442\u043e\u0438\u043b\u043e \u043d\u0430\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438: \u0443\u0437\u0435\u043b\u00a0Hash\u00a0\u0437\u0430\u043c\u0435\u0434\u043b\u0438\u043b\u0441\u044f \u0441 17,3 \u0434\u043e 25,5 \u043c\u0441. \u042d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0446\u0435\u043d\u0430 \u0444\u0438\u0447\u0438 &#8212; \u043f\u043b\u0430\u0442\u0430 \u0437\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435.\u0428\u0430\u0433 2. \u041f\u0440\u043e\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043d\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432\u043d\u0438\u0437 (pushdown).\u041e\u0431\u044b\u0447\u043d\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\u00a0o.customer_id = c.customer_id\u00a0\u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0443\u0437\u043b\u0435\u00a0Hash Join\u00a0&#8212; \u0442\u043e \u0435\u0441\u0442\u044c \u0432\u0441\u0435 10 \u043c\u043b\u043d \u0441\u0442\u0440\u043e\u043a\u00a0orders\u00a0\u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0435\u0445\u0430\u0442\u044c \u043e\u0442\u00a0Seq Scan\u00a0\u0434\u043e\u00a0Hash Join, \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043c \u0432\u044b\u044f\u0441\u043d\u0438\u0442\u0441\u044f, \u0447\u0442\u043e 99% \u0438\u0437 \u043d\u0438\u0445 \u043d\u0435 \u043d\u0443\u0436\u043d\u044b.Bloom-\u0444\u0438\u043b\u044c\u0442\u0440 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u044d\u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0440\u0430\u043d\u044c\u0448\u0435 &#8212; \u043f\u0440\u044f\u043c\u043e \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f\u00a0orders. \u0421\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043b\u0430\u043d:-&gt; Seq Scan on public.orders o (actual time=0.034..806.095 rows=100286.00 loops=1)     Bloom Filter 1: keys=(o.customer_id) checked=9999999 rejected=9899714 (99.0%)\u0421\u0442\u0440\u043e\u043a\u0430\u00a0Bloom Filter\u00a0\u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0432\u043d\u0443\u0442\u0440\u0438\u00a0Seq Scan. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 10 \u043c\u043b\u043d \u043f\u0440\u043e\u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0442\u0440\u043e\u043a (checked=9999999) \u0444\u0438\u043b\u044c\u0442\u0440 \u043e\u0442\u0432\u0435\u0447\u0430\u043b \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u00ab\u0430 \u0435\u0441\u0442\u044c \u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0430\u043a\u043e\u0439 customer_id \u0441\u0440\u0435\u0434\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432?\u00bb. \u0412 9 899 714 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043e\u0442\u0432\u0435\u0442 \u0431\u044b\u043b \u00ab\u0442\u043e\u0447\u043d\u043e \u043d\u0435\u0442\u00bb (rejected), \u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043b\u0430\u0441\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0430 \u0443\u0437\u043b\u0435 \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b\u00a0orders.\u0412\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0443\u0437\u043b\u0430 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u043e\u0441\u044c \u0441 602 \u0434\u043e 806 \u043c\u0441 &#8212; \u044d\u0442\u043e \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u044b \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 bloom-\u0444\u0438\u043b\u044c\u0442\u0440\u0430.\u0428\u0430\u0433 3. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.\u0418\u0437\u00a0Seq Scan\u00a0\u043d\u0430\u0432\u0435\u0440\u0445, \u043a\u00a0Hash Join, \u0432\u044b\u0448\u043b\u043e \u043d\u0435 10 \u043c\u043b\u043d \u0441\u0442\u0440\u043e\u043a, \u0430 \u0432\u0441\u0435\u0433\u043e 100 286 (rows=100286.00). \u0418\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0434\u043e\u0448\u043b\u0438 \u0434\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f\u00a0Hash Join.\u041e\u0442\u043a\u0443\u0434\u0430 \u0432\u0437\u044f\u043b\u0438\u0441\u044c \u043b\u0438\u0448\u043d\u0438\u0435 233 \u0441\u0442\u0440\u043e\u043a\u0438? \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 &#8212; 100 053 \u0441\u0442\u0440\u043e\u043a\u0438, \u0430 \u0444\u0438\u043b\u044c\u0442\u0440 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b 100 286. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 233 \u0441\u0442\u0440\u043e\u043a\u0438 &#8212; \u044d\u0442\u043e \u043b\u043e\u0436\u043d\u043e\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f: \u0434\u043b\u044f \u043d\u0438\u0445 \u0432\u0441\u0435 \u0434\u0435\u0441\u044f\u0442\u044c \u0431\u0438\u0442\u043e\u0432 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0438 \u0444\u0438\u043b\u044c\u0442\u0440 \u0441\u043a\u0430\u0437\u0430\u043b \u00ab\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0435\u0441\u0442\u044c\u00bb. \u041e\u0448\u0438\u0431\u043a\u0438 \u044d\u0442\u043e \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442: \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043d\u0430\u0439\u0434\u0443\u0442 \u043f\u0430\u0440\u0443 \u0432 \u0445\u0435\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0438 \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0431\u0440\u043e\u0448\u0435\u043d\u044b \u0443\u0436\u0435 \u043d\u0430 \u0443\u0437\u043b\u0435\u00a0Hash Join. \u0424\u0438\u043b\u044c\u0442\u0440 \u0411\u043b\u0443\u043c\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u0448\u0438\u0431\u0438\u0442\u044c\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443: \u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043e\u043d \u043d\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c.\u0421\u0440\u0430\u0432\u043d\u0438\u043c \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u043e\u0432 \u043f\u043b\u0430\u043d\u0430:\u0423\u0437\u0435\u043bBloom offBloom onSeq Scan on orders602806Hash1725Hash Join109946\u0417\u0430\u043f\u0440\u043e\u0441 \u0446\u0435\u043b\u0438\u043a\u043e\u043c1719878\u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u0437\u0430\u043f\u0440\u043e\u0441 \u0443\u0441\u043a\u043e\u0440\u0438\u043b\u0441\u044f \u0432\u0434\u0432\u043e\u0435 \u0438\u0437-\u0437\u0430 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u0430\u043c\u043e\u0439 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0435\u043c\u043a\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 &#8212; Hash Join.\u0410 \u043c\u043e\u0436\u0435\u0442 \u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 bloom-\u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0445\u0443\u0436\u0435? \u0414\u0430, \u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0437\u0430\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u0435\u0433\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043a\u043e\u043c\u043f\u0435\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438\u00a0Hash Join. \u0421\u044d\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439:TRUNCATE active_customers;INSERT INTO active_customersSELECT generate_series(1, 9500000);  &#8212; 95% \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043a\u043b\u044e\u0447\u0435\u0439\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 bloom-\u0444\u0438\u043b\u044c\u0442\u0440 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043a\u0438\u043d\u0443\u0442\u044c \u043d\u0435 99% \u0441\u0442\u0440\u043e\u043a \u043a\u0430\u043a \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435, \u0430 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c 5%, \u0442.\u043a. \u043f\u043e\u0447\u0442\u0438 \u043a\u0430\u0436\u0434\u044b\u0439\u00a0customer_id\u00a0\u0438\u0437\u00a0orders\u00a0\u043d\u0430\u0439\u0434\u0435\u0442\u0441\u044f \u0441\u0440\u0435\u0434\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u044b\u00a0active_customers.enable_hashjoin_bloom = off:&#187;Hash Join (actual time=3686.180..10541.744 rows=9499724.00 loops=1)&#187;&#187;  Hash Cond: (c.customer_id = o.customer_id)&#187;&#187;  -&gt;  Seq Scan on public.active_customers c (actual time=0.063..613.167 rows=9500000.00 loops=1)&#187;&#187;  -&gt;  Hash (actual time=3581.865..3581.872 rows=10000000.00 loops=1)&#187;&#187;        Buckets: 16777216  Batches: 1  Memory Usage: 521697kB&#187;&#187;        -&gt;  Seq Scan on public.orders o (actual time=0.053..700.691 rows=10000000.00 loops=1)&#187;enable_hashjoin_bloom = on:&#187;Hash Join (actual time=5414.793..12388.729 rows=9499724.00 loops=1)&#187;&#187;  Hash Cond: (o.customer_id = c.customer_id)&#187;&#187;  -&gt;  Seq Scan on public.orders o (actual time=0.034..741.536 rows=9995087.00 loops=1)&#187;&#187;        Bloom Filter 1: keys=(o.customer_id) checked=100989 rejected=4913 (4.9%)&#187;&#187;  -&gt;  Hash (actual time=5321.682..5321.684 rows=9500000.00 loops=1)&#187;&#187;        Buckets: 16777216  Batches: 1  Memory Usage: 465057kB&#187;&#187;        Bloom Filter 1: bits=134217728 hashes=10 memory=16384kB checked=100989 rejected=4913&#8243;&#187;        -&gt;  Seq Scan on public.active_customers c (actual time=0.064..670.680 rows=9500000.00 loops=1)&#187;\u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043b\u0430\u043d, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u044b\u00a0active_costumers\u00a0\u0438\u00a0orders\u00a0\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043c\u0435\u0441\u0442\u0430\u043c\u0438 \u043f\u0440\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445\u00a0enable_hashjoin_bloom. \u0414\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0443\u0437\u043b\u043e\u0432 \u044d\u0442\u043e \u043d\u0435 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u043e, \u0442.\u043a. \u043e\u0431\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439.\u0421\u0440\u0430\u0432\u043d\u0438\u043c \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u043e\u0432 \u043f\u043b\u0430\u043d\u0430:\u0423\u0437\u0435\u043bBloom offBloom onSeq Scan on orders613741Hash3 5815 321Hash Join6 3466 325\u0417\u0430\u043f\u0440\u043e\u0441 \u0446\u0435\u043b\u0438\u043a\u043e\u043c10 54112 388\u041c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u043e\u0441\u044c \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0443\u0437\u043b\u0430\u00a0Hash, \u0442.\u043a. \u043f\u0440\u0438 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0445\u0435\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u043c\u0435\u0441\u0442\u043e 100 \u0442\u044b\u0441. \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0431\u043e\u0440 \u0445\u0435\u0448-\u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 bloom-\u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u044e\u0442\u0441\u044f 9.5 \u043c\u043b\u043d \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u0433\u043e bloom-\u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043f\u0440\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438\u00a0Seq Scan on orders\u00a0\u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u044e \u0432\u0441\u0435\u0433\u043e 4.9% \u0441\u0442\u0440\u043e\u043a (rejected=4913), \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u0441\u0435\u0433\u043e 100 \u0442\u044b\u0441\u044f\u0447 \u0441\u0442\u0440\u043e\u043a \u0438\u0437 10 \u043c\u043b\u043d (checked=100989). \u041f\u043e\u0447\u0435\u043c\u0443? \u0414\u0435\u043b\u043e \u0432 \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u043e\u043c \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430: \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c \u0441\u043b\u0435\u0434\u0438\u0442 \u0437\u0430 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c\u044e \u0444\u0438\u043b\u044c\u0442\u0440\u0430 \u043d\u0430 \u043b\u0435\u0442\u0443, \u0438 \u0435\u0441\u043b\u0438 \u0442\u043e\u0442 \u043d\u0435 \u043e\u043f\u0440\u0430\u0432\u0434\u044b\u0432\u0430\u0435\u0442 \u0441\u0435\u0431\u044f, \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0451\u0442 \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c. \u0410 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0443\u0437\u043b\u0430\u00a0Hash Join\u00a0\u043f\u043e\u0447\u0442\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e, \u0442.\u043a. \u0435\u043c\u0443 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0438\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a.\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u044b\u0442\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u0431\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0432\u043e\u0437\u0440\u043e\u0441\u043b\u043e \u043d\u0430 15% \u0438\u0437-\u0437\u0430 \u0437\u0430\u0442\u0440\u0430\u0442 \u043d\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 bloom-\u0444\u0438\u043b\u044c\u0442\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u043b \u043d\u0430 \u043b\u0435\u0442\u0443 \u0438\u0437-\u0437\u0430 \u0435\u0433\u043e \u043d\u0438\u0437\u043a\u043e\u0439 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438.\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445\u041f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 1\u0421 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0435 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b,\u00a0\u043d\u0430 \u043d\u0435\u0439 \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u0439\u0442\u0438\u00a0\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0447\u0442\u0438 \u043b\u044e\u0431\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432.\u0412 1\u0421:ERP \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043a\u0430\u043a \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u043c\u0435\u0441\u044f\u0446\u0430, \u0438 \u0432 \u0445\u043e\u0434\u0435 \u0435\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u043f\u043e\u0434 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f bloom-\u0444\u0438\u043b\u044c\u0442\u0440\u0430, \u0442.\u043a. \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u0442\u044b\u0441\u044f\u0447\u0430\u043c\u0438 \u0438 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0430\u043c\u0438 \u0437\u0430\u043f\u0438\u0441\u0435\u0439. \u0412\u043e\u0442 \u043e\u0434\u0438\u043d \u0438\u0437 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b bloom-\u0444\u0438\u043b\u044c\u0442\u0440:off &#8212;\u00a0https:\/\/explain.tensor.ru\/archive\/explain\/6f12119c3ff724f469d3f23c0a9fd261:0:2026-06-29on&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-487631","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/487631","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=487631"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/487631\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=487631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=487631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=487631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}