explain.depesz.com

PostgreSQL's explain analyze made readable

Result: J4QJ

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 769,292.226 ↑ 1.0 2 1

Unique (cost=7,480,201.32..7,480,201.37 rows=2 width=320) (actual time=769,292.223..769,292.226 rows=2 loops=1)

2.          

CTE doc_exec

3. 45,774.465 228,203.244 ↓ 1.1 409,153 1

Bitmap Heap Scan on docs_executive e_2 (cost=89,956.79..4,614,000.59 rows=384,781 width=36) (actual time=4,881.289..228,203.244 rows=409,153 loops=1)

  • Recheck Cond: ((dat_sost >= date_trunc('year'::text, (('now'::cstring)::date)::timestamp with time zone)) AND (dat_sost <= (('now'::cstring)::date - '1 day'::interval)) AND ((ogai_sost_kod)::text = '45597'::text))
  • Rows Removed by Index Recheck: 1,188,504
  • Heap Blocks: exact=63,844 lossy=384,976
4. 40.036 4,856.377 ↓ 0.0 0 1

BitmapAnd (cost=89,956.79..89,956.79 rows=384,781 width=0) (actual time=4,856.377..4,856.377 rows=0 loops=1)

5. 455.296 455.296 ↓ 1.1 920,198 1

Bitmap Index Scan on docs_executive_dat_sost (cost=0.00..16,838.16 rows=808,251 width=0) (actual time=455.296..455.296 rows=920,198 loops=1)

  • Index Cond: ((dat_sost >= date_trunc('year'::text, (('now'::cstring)::date)::timestamp with time zone)) AND (dat_sost <= (('now'::cstring)::date - '1 day'::interval)))
6. 4,361.045 4,361.045 ↓ 1.0 2,218,383 1

Bitmap Index Scan on docs_executive_status_id_kod (cost=0.00..72,925.98 rows=2,145,293 width=0) (actual time=4,361.045..4,361.045 rows=2,218,383 loops=1)

  • Index Cond: ((ogai_sost_kod)::text = '45597'::text)
7.          

SubPlan (for Bitmap Heap Scan)

8. 409.153 177,572.402 ↑ 1.0 1 409,153

Aggregate (cost=10.78..10.79 rows=1 width=8) (actual time=0.434..0.434 rows=1 loops=409,153)

9. 177,163.249 177,163.249 ↑ 10.0 1 409,153

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.394..0.433 rows=1 loops=409,153)

  • Index Cond: (docs_id = e_2.docs_id)
  • Filter: (spi_doc_type = '272'::numeric)
  • Rows Removed by Filter: 0
10. 0.107 769,292.224 ↑ 1.0 2 1

Sort (cost=2,866,200.73..2,866,200.73 rows=2 width=320) (actual time=769,292.223..769,292.224 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
11. 0.002 769,292.117 ↑ 1.0 2 1

Append (cost=1,433,100.28..2,866,200.72 rows=2 width=320) (actual time=562,631.475..769,292.117 rows=2 loops=1)

12. 0.005 562,631.474 ↑ 1.0 1 1

Subquery Scan on *SELECT* 1 (cost=1,433,100.28..1,433,100.36 rows=1 width=320) (actual time=562,631.474..562,631.474 rows=1 loops=1)

13. 1,091.541 562,631.469 ↑ 1.0 1 1

Aggregate (cost=1,433,100.28..1,433,100.34 rows=1 width=200) (actual time=562,631.469..562,631.469 rows=1 loops=1)

14. 682.289 561,539.928 ↑ 5.2 369,392 1

Nested Loop (cost=1.13..1,342,384.78 rows=1,909,800 width=58) (actual time=4,891.044..561,539.928 rows=369,392 loops=1)

15. 639.672 457,751.083 ↓ 1.1 409,153 1

Nested Loop Left Join (cost=0.56..802,123.96 rows=384,781 width=90) (actual time=4,882.319..457,751.083 rows=409,153 loops=1)

16. 228,804.037 228,804.037 ↓ 1.1 409,153 1

CTE Scan on doc_exec e (cost=0.00..7,695.62 rows=384,781 width=84) (actual time=4,881.291..228,804.037 rows=409,153 loops=1)

17. 228,307.374 228,307.374 ↓ 0.0 0 409,153

Index Scan using decis_pkey on decis d (cost=0.56..2.05 rows=1 width=12) (actual time=0.558..0.558 rows=0 loops=409,153)

  • Index Cond: (decis_id = e.decis_id)
  • Filter: ((sum_opl IS NOT NULL) AND (decis_kod = '65'::numeric))
  • Rows Removed by Filter: 1
18. 103,106.556 103,106.556 ↑ 5.0 1 409,153

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

  • Index Cond: ((decis_id = e.decis_id) AND (stad_ispoln_kod = '5'::numeric))
  • Heap Fetches: 10,107
19. 872.346 206,660.641 ↑ 1.0 1 1

Aggregate (cost=1,433,100.31..1,433,100.35 rows=1 width=320) (actual time=206,660.641..206,660.641 rows=1 loops=1)

20. 606.764 205,788.295 ↑ 5.2 369,392 1

Nested Loop (cost=1.13..1,342,384.78 rows=1,909,800 width=49) (actual time=2.901..205,788.295 rows=369,392 loops=1)

21. 364.927 172,449.291 ↓ 1.1 409,153 1

Nested Loop Left Join (cost=0.56..802,123.96 rows=384,781 width=81) (actual time=2.658..172,449.291 rows=409,153 loops=1)

22. 240.104 240.104 ↓ 1.1 409,153 1

CTE Scan on doc_exec e_1 (cost=0.00..7,695.62 rows=384,781 width=70) (actual time=1.812..240.104 rows=409,153 loops=1)

23. 171,844.260 171,844.260 ↓ 0.0 0 409,153

Index Scan using decis_pkey on decis d_1 (cost=0.56..2.05 rows=1 width=17) (actual time=0.420..0.420 rows=0 loops=409,153)

  • Index Cond: (decis_id = e_1.decis_id)
  • Filter: ((sum_opl IS NOT NULL) AND (decis_kod = '65'::numeric))
  • Rows Removed by Filter: 1
24. 32,732.240 32,732.240 ↑ 5.0 1 409,153

Index Only Scan using di_decis_stad on decis_ispoln di_1 (cost=0.56..1.35 rows=5 width=6) (actual time=0.079..0.080 rows=1 loops=409,153)

  • Index Cond: ((decis_id = e_1.decis_id) AND (stad_ispoln_kod = '5'::numeric))
  • Heap Fetches: 10,107
Planning time : 2.487 ms
Execution time : 769,295.789 ms