explain.depesz.com

PostgreSQL's explain analyze made readable

Result: a2UK

Settings
# exclusive inclusive rows x rows loops node
1. 288.109 1,059,228.862 ↑ 1.0 1 1

Aggregate (cost=709,868.26..709,868.27 rows=1 width=8) (actual time=1,059,228.862..1,059,228.862 rows=1 loops=1)

2. 760.783 1,058,940.753 ↓ 490.0 846,667 1

Hash Join (cost=48,222.26..709,863.94 rows=1,728 width=0) (actual time=83,651.553..1,058,940.753 rows=846,667 loops=1)

  • Hash Cond: (post.stotv_id = stotv.stotv_id)
3. 1,252.339 1,058,179.562 ↓ 490.0 846,667 1

Nested Loop (cost=48,203.64..709,821.56 rows=1,728 width=7) (actual time=83,651.112..1,058,179.562 rows=846,667 loops=1)

  • Join Filter: (prek.docs_post_main_id = post.docs_id)
4. 739.382 964,635.506 ↓ 460.7 846,713 1

Nested Loop (cost=48,203.21..708,003.78 rows=1,838 width=13) (actual time=83,651.073..964,635.506 rows=846,713 loops=1)

5. 744.212 607,955.292 ↓ 20.1 872,404 1

Hash Join (cost=48,202.65..657,839.73 rows=43,345 width=19) (actual time=934.726..607,955.292 rows=872,404 loops=1)

  • Hash Cond: (prek.stotv_id = prek_stotv.stotv_id)
6. 3,708.304 607,210.635 ↓ 1.1 872,404 1

Merge Join (cost=48,125.41..654,288.16 rows=810,905 width=26) (actual time=934.262..607,210.635 rows=872,404 loops=1)

  • Merge Cond: (prek.docs_post_main_id = decis.docs_post_id)
7. 164,719.707 164,719.707 ↑ 17.1 872,405 1

Index Scan using docs_post_idx2 on docs_post prek (cost=0.42..799,541.55 rows=14,952,165 width=20) (actual time=1.174..164,719.707 rows=872,405 loops=1)

  • Filter: ((doc_state = 2) AND (dat_sost <= (('now'::cstring)::date - '1 day'::interval)) AND (dat_sost >= date_trunc('year'::text, (('now'::cstring)::date - '5 years'::interval))))
  • Rows Removed by Filter: 10,582
8. 438,782.624 438,782.624 ↑ 1.4 15,540,105 1

Index Only Scan using decis_docs_post_id on decis (cost=0.56..544,884.40 rows=22,363,924 width=6) (actual time=0.568..438,782.624 rows=15,540,105 loops=1)

  • Heap Fetches: 1,718,686
9. 0.007 0.445 ↑ 1.0 24 1

Hash (cost=76.93..76.93 rows=24 width=10) (actual time=0.445..0.445 rows=24 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
10. 0.029 0.438 ↑ 1.0 24 1

Nested Loop (cost=0.27..76.93 rows=24 width=10) (actual time=0.025..0.438 rows=24 loops=1)

11. 0.385 0.385 ↑ 1.0 24 1

Seq Scan on s_stotv (cost=0.00..63.73 rows=24 width=5) (actual time=0.011..0.385 rows=24 loops=1)

  • Filter: (((priz_prekr)::text = '+'::text) OR ((priz_prekr_ispoln)::text = '+'::text))
  • Rows Removed by Filter: 424
12. 0.024 0.024 ↑ 1.0 1 24

Index Only Scan using s_stotv_pkey on s_stotv prek_stotv (cost=0.27..0.54 rows=1 width=5) (actual time=0.001..0.001 rows=1 loops=24)

  • Index Cond: (stotv_id = s_stotv.stotv_id)
  • Heap Fetches: 5
13. 355,940.832 355,940.832 ↑ 1.0 1 872,404

Index Scan using delo_pkey on delo (cost=0.56..1.15 rows=1 width=6) (actual time=0.407..0.408 rows=1 loops=872,404)

  • Index Cond: (delo_id = prek.delo_id)
  • Filter: ((stad_delo_kod = '7'::numeric) AND ((ogai_vozb_kod)::text = '45597'::text))
  • Rows Removed by Filter: 0
14. 92,291.717 92,291.717 ↑ 1.0 1 846,713

Index Scan using docs_post_pkey on docs_post post (cost=0.43..0.98 rows=1 width=13) (actual time=0.106..0.109 rows=1 loops=846,713)

  • Index Cond: (docs_id = decis.docs_post_id)
  • Filter: (doc_n IS NOT NULL)
  • Rows Removed by Filter: 0
15. 0.068 0.408 ↑ 1.0 448 1

Hash (cost=13.01..13.01 rows=449 width=5) (actual time=0.408..0.408 rows=448 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 25kB
16. 0.340 0.340 ↑ 1.0 448 1

Index Only Scan using s_stotv_pkey on s_stotv stotv (cost=0.27..13.01 rows=449 width=5) (actual time=0.036..0.340 rows=448 loops=1)

  • Heap Fetches: 224
Planning time : 2.386 ms
Execution time : 1,059,241.536 ms