explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PYhJr

Settings
# exclusive inclusive rows x rows loops node
1. 283.845 733,647.408 ↑ 1.0 1 1

Aggregate (cost=764,023.12..764,023.13 rows=1 width=8) (actual time=733,647.408..733,647.408 rows=1 loops=1)

2. 745.629 733,363.563 ↓ 702.1 846,728 1

Hash Join (cost=11,653.06..764,020.11 rows=1,206 width=0) (actual time=521.228..733,363.563 rows=846,728 loops=1)

  • Hash Cond: (post.stotv_id = stotv.stotv_id)
3. 1,987.540 732,616.770 ↓ 702.1 846,728 1

Nested Loop (cost=11,634.44..763,984.91 rows=1,206 width=7) (actual time=520.008..732,616.770 rows=846,728 loops=1)

  • Join Filter: (prek.docs_post_main_id = post.docs_id)
4. 790.863 656,117.166 ↓ 693.5 846,728 1

Nested Loop (cost=11,634.00..762,771.99 rows=1,221 width=13) (actual time=512.367..656,117.166 rows=846,728 loops=1)

5. 712.137 115,308.227 ↓ 371.1 872,404 1

Nested Loop (cost=11,633.44..758,393.89 rows=2,351 width=19) (actual time=511.080..115,308.227 rows=872,404 loops=1)

6. 649.901 22,993.565 ↓ 20.1 872,405 1

Hash Join (cost=11,632.88..712,257.63 rows=43,345 width=13) (actual time=510.644..22,993.565 rows=872,405 loops=1)

  • Hash Cond: (prek.stotv_id = prek_stotv.stotv_id)
7. 21,844.958 22,343.211 ↓ 1.1 872,405 1

Bitmap Heap Scan on docs_post prek (cost=11,555.64..708,706.01 rows=810,917 width=20) (actual time=510.171..22,343.211 rows=872,405 loops=1)

  • Recheck Cond: (docs_post_main_id IS NOT NULL)
  • Rows Removed by Index Recheck: 3,118,201
  • 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
  • Heap Blocks: exact=50,781 lossy=319,541
8. 498.253 498.253 ↓ 1.0 883,989 1

Bitmap Index Scan on docs_post_idx2 (cost=0.00..11,352.91 rows=854,978 width=0) (actual time=498.253..498.253 rows=883,989 loops=1)

9. 0.008 0.453 ↑ 1.0 24 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
10. 0.010 0.445 ↑ 1.0 24 1

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

11. 0.387 0.387 ↑ 1.0 24 1

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

  • Filter: (((priz_prekr)::text = '+'::text) OR ((priz_prekr_ispoln)::text = '+'::text))
  • Rows Removed by Filter: 424
12. 0.048 0.048 ↑ 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.002 rows=1 loops=24)

  • Index Cond: (stotv_id = s_stotv.stotv_id)
  • Heap Fetches: 5
13. 91,602.525 91,602.525 ↑ 1.0 1 872,405

Index Only Scan using decis_docs_post_id on decis (cost=0.56..1.05 rows=1 width=6) (actual time=0.105..0.105 rows=1 loops=872,405)

  • Index Cond: (docs_post_id = prek.docs_post_main_id)
  • Heap Fetches: 47,738
14. 540,018.076 540,018.076 ↑ 1.0 1 872,404

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

  • Index Cond: (delo_id = prek.delo_id)
  • Filter: ((ogai_vozb_kod)::text = '45597'::text)
  • Rows Removed by Filter: 0
15. 74,512.064 74,512.064 ↑ 1.0 1 846,728

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

  • Index Cond: (docs_id = decis.docs_post_id)
16. 0.089 1.164 ↑ 1.0 448 1

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

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

  • Heap Fetches: 224
Planning time : 2.293 ms
Execution time : 733,650.336 ms