explain.depesz.com

PostgreSQL's explain analyze made readable

Result: olji

Settings
# exclusive inclusive rows x rows loops node
1. 321.603 1,113,834.295 ↑ 1.0 1 1

Aggregate (cost=649,475.61..649,475.62 rows=1 width=8) (actual time=1,113,834.294..1,113,834.295 rows=1 loops=1)

2. 806.365 1,113,512.692 ↓ 9,007.1 846,667 1

Hash Join (cost=48,222.64..649,475.37 rows=94 width=0) (actual time=62,831.291..1,113,512.692 rows=846,667 loops=1)

  • Hash Cond: (post.stotv_id = stotv.stotv_id)
3. 956.808 1,112,705.738 ↓ 9,007.1 846,667 1

Nested Loop (cost=48,204.02..649,455.46 rows=94 width=7) (actual time=62,830.637..1,112,705.738 rows=846,667 loops=1)

  • Join Filter: (prek.docs_post_main_id = post.docs_id)
4. 1,119.766 957,647.164 ↓ 8,467.1 846,713 1

Nested Loop (cost=48,203.59..649,356.56 rows=100 width=13) (actual time=62,830.282..957,647.164 rows=846,713 loops=1)

5. 765.618 494,153.278 ↓ 371.1 872,404 1

Hash Join (cost=48,203.03..644,972.59 rows=2,351 width=19) (actual time=2,372.136..494,153.278 rows=872,404 loops=1)

  • Hash Cond: (prek.stotv_id = prek_stotv.stotv_id)
6. 3,422.356 493,387.211 ↓ 19.8 872,404 1

Merge Join (cost=48,125.79..644,706.93 rows=43,979 width=26) (actual time=2,371.660..493,387.211 rows=872,404 loops=1)

  • Merge Cond: (prek.docs_post_main_id = decis.docs_post_id)
7. 281,970.557 281,970.557 ↓ 1.1 872,405 1

Index Scan using docs_post_idx2 on docs_post prek (cost=0.42..799,551.55 rows=810,915 width=20) (actual time=13.194..281,970.557 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. 207,994.298 207,994.298 ↑ 1.4 15,540,105 1

Index Only Scan using decis_docs_post_id on decis (cost=0.56..544,889.20 rows=22,363,924 width=6) (actual time=1.604..207,994.298 rows=15,540,105 loops=1)

  • Heap Fetches: 1,701,396
9. 0.013 0.449 ↑ 1.0 24 1

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

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

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

11. 0.383 0.383 ↑ 1.0 24 1

Seq Scan on s_stotv (cost=0.00..63.73 rows=24 width=5) (actual time=0.010..0.383 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. 462,374.120 462,374.120 ↑ 1.0 1 872,404

Index Scan using delo_pkey on delo (cost=0.56..1.85 rows=1 width=6) (actual time=0.530..0.530 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. 154,101.766 154,101.766 ↑ 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.180..0.182 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.065 0.589 ↑ 1.0 448 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 25kB
16. 0.524 0.524 ↑ 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.033..0.524 rows=448 loops=1)

  • Heap Fetches: 224
Planning time : 2.661 ms
Execution time : 1,113,835.024 ms