explain.depesz.com

PostgreSQL's explain analyze made readable

Result: t5YA

Settings
# exclusive inclusive rows x rows loops node
1. 4,150.763 1,469,017.145 ↓ 460.7 846,713 1

Nested Loop Left Join (cost=11,657.90..799,756.06 rows=1,838 width=195) (actual time=1,512.651..1,469,017.145 rows=846,713 loops=1)

2. 790.177 808,663.807 ↓ 460.7 846,713 1

Nested Loop (cost=11,657.47..786,588.64 rows=1,838 width=73) (actual time=1,506.408..808,663.807 rows=846,713 loops=1)

3. 1,188.145 41,902.040 ↓ 20.1 872,405 1

Hash Join (cost=11,656.91..712,286.08 rows=43,345 width=79) (actual time=1,485.892..41,902.040 rows=872,405 loops=1)

  • Hash Cond: (prek.stotv_id = prek_stotv.stotv_id)
4. 39,238.983 40,713.235 ↓ 1.1 872,405 1

Bitmap Heap Scan on docs_post prek (cost=11,555.67..708,710.44 rows=810,922 width=71) (actual time=1,485.185..40,713.235 rows=872,405 loops=1)

  • Recheck Cond: (docs_post_main_id IS NOT NULL)
  • Rows Removed by Index Recheck: 3,118,196
  • 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
5. 1,474.252 1,474.252 ↓ 1.0 883,989 1

Bitmap Index Scan on docs_post_idx2 (cost=0.00..11,352.94 rows=854,983 width=0) (actual time=1,474.252..1,474.252 rows=883,989 loops=1)

6. 0.012 0.660 ↑ 1.0 24 1

Hash (cost=100.93..100.93 rows=24 width=25) (actual time=0.660..0.660 rows=24 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
7. 0.021 0.648 ↑ 1.0 24 1

Nested Loop (cost=0.27..100.93 rows=24 width=25) (actual time=0.043..0.648 rows=24 loops=1)

8. 0.579 0.579 ↑ 1.0 24 1

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

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

Index Scan using s_stotv_pkey on s_stotv prek_stotv (cost=0.27..1.54 rows=1 width=20) (actual time=0.002..0.002 rows=1 loops=24)

  • Index Cond: (stotv_id = s_stotv.stotv_id)
10. 765,971.590 765,971.590 ↑ 1.0 1 872,405

Index Scan using delo_pkey on delo (cost=0.56..1.70 rows=1 width=6) (actual time=0.877..0.878 rows=1 loops=872,405)

  • 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
11. 130,393.802 130,393.802 ↑ 1.0 1 846,713

Index Scan using docs_post_pkey on docs_post post (cost=0.43..1.48 rows=1 width=46) (actual time=0.154..0.154 rows=1 loops=846,713)

  • Index Cond: (docs_id = prek.docs_post_main_id)
12.          

SubPlan (for Nested Loop Left Join)

13. 519,881.782 519,881.782 ↑ 1.0 1 846,713

Index Scan using decis_docs_post_id on decis (cost=0.56..2.98 rows=1 width=5) (actual time=0.613..0.614 rows=1 loops=846,713)

  • Index Cond: (docs_post_id = post.docs_id)
14. 5,926.991 5,926.991 ↑ 1.0 1 846,713

Index Scan using s_stotv_pkey on s_stotv stotv (cost=0.27..2.69 rows=1 width=15) (actual time=0.007..0.007 rows=1 loops=846,713)

  • Index Cond: (stotv_id = post.stotv_id)
Planning time : 1.208 ms
Execution time : 1,469,153.137 ms