explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9ucG

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 146,907.910 ↑ 1.0 2 1

Unique (cost=5,331,138.70..5,331,138.75 rows=2 width=320) (actual time=146,907.907..146,907.910 rows=2 loops=1)

2.          

CTE doc_exec

3. 0.000 145,597.291 ↓ 1.0 369,392 1

Gather (cost=1,001.13..5,282,062.92 rows=363,523 width=41) (actual time=26.610..145,597.291 rows=369,392 loops=1)

  • Workers Planned: 6
  • Workers Launched: 6
4. 128.510 67,348.086 ↑ 1.1 52,770 7 / 7

Nested Loop (cost=1.13..1,321,322.88 rows=60,587 width=33) (actual time=12.361..67,348.086 rows=52,770 loops=7)

  • Join Filter: (e_2.decis_id = di.decis_id)
5. 73.466 56,172.445 ↑ 1.1 58,450 7 / 7

Nested Loop (cost=0.56..1,266,849.53 rows=64,130 width=39) (actual time=4.924..56,172.445 rows=58,450 loops=7)

6. 7,994.276 7,994.276 ↑ 1.1 58,450 7 / 7

Parallel Seq Scan on docs_executive e_2 (cost=0.00..1,134,302.67 rows=64,130 width=28) (actual time=1.307..7,994.276 rows=58,450 loops=7)

  • Filter: (((ogai_sost_kod)::text = '45597'::text) AND (dat_sost <= (('now'::cstring)::date - '1 day'::interval)) AND (dat_sost >= date_trunc('year'::text, (('now'::cstring)::date)::timestamp with time zone)))
  • Rows Removed by Filter: 580,813
7. 48,104.703 48,104.703 ↑ 1.0 1 409,153 / 7

Index Scan using decis_pkey on decis d (cost=0.56..2.06 rows=1 width=11) (actual time=0.821..0.823 rows=1 loops=409,153)

  • Index Cond: (decis_id = e_2.decis_id)
8. 11,047.131 11,047.131 ↑ 5.0 1 409,153 / 7

Index Only Scan using di_decis_stad on decis_ispoln di (cost=0.56..0.79 rows=5 width=6) (actual time=0.188..0.189 rows=1 loops=409,153)

  • Index Cond: ((decis_id = d.decis_id) AND (stad_ispoln_kod = '5'::numeric))
  • Heap Fetches: 75
9.          

SubPlan (for Gather)

10. 369.392 142,215.920 ↑ 1.0 1 369,392

Aggregate (cost=10.78..10.79 rows=1 width=8) (actual time=0.385..0.385 rows=1 loops=369,392)

11. 141,846.528 141,846.528 ↑ 10.0 1 369,392

Index Scan using docs_executive_post_docs_id on docs_executive_post p (cost=0.43..10.76 rows=10 width=0) (actual time=0.356..0.384 rows=1 loops=369,392)

  • Index Cond: (docs_id = e_2.docs_id)
  • Filter: (spi_doc_type = '272'::numeric)
  • Rows Removed by Filter: 1
12. 0.096 146,907.907 ↑ 1.0 2 1

Sort (cost=49,075.78..49,075.78 rows=2 width=320) (actual time=146,907.906..146,907.907 rows=2 loops=1)

  • Sort Key: ('штук'::text), (("*SELECT* 1"."Направлено в ФССП")::numeric), (("*SELECT* 1"."Возбуждено")::numeric), "*SELECT* 1"."Процент возбужденнных", (("*SELECT* 1"."Отказ")::numeric), "*SELECT* 1"."Процент отказанных", (("*SELECT* 1"."Взыскано")::numeric), "*SELECT* 1"."Процент взысканных", (("*SELECT* 1"."Прекращено")::numeric), "*SELECT* 1"."Процент прекращенных
  • Sort Method: quicksort Memory: 25kB
13. 0.001 146,907.811 ↑ 1.0 2 1

Append (cost=24,537.80..49,075.77 rows=2 width=320) (actual time=146,519.548..146,907.811 rows=2 loops=1)

14. 0.005 146,519.549 ↑ 1.0 1 1

Subquery Scan on *SELECT* 1 (cost=24,537.80..24,537.88 rows=1 width=320) (actual time=146,519.548..146,519.549 rows=1 loops=1)

15. 547.624 146,519.544 ↑ 1.0 1 1

Aggregate (cost=24,537.80..24,537.86 rows=1 width=200) (actual time=146,519.542..146,519.544 rows=1 loops=1)

16. 145,971.920 145,971.920 ↓ 1.0 369,392 1

CTE Scan on doc_exec e (cost=0.00..7,270.46 rows=363,523 width=70) (actual time=26.614..145,971.920 rows=369,392 loops=1)

17. 327.340 388.261 ↑ 1.0 1 1

Aggregate (cost=24,537.84..24,537.88 rows=1 width=320) (actual time=388.261..388.261 rows=1 loops=1)

18. 60.921 60.921 ↓ 1.0 369,392 1

CTE Scan on doc_exec e_1 (cost=0.00..7,270.46 rows=363,523 width=56) (actual time=3.327..60.921 rows=369,392 loops=1)

Planning time : 1.581 ms
Execution time : 146,927.092 ms