explain.depesz.com

PostgreSQL's explain analyze made readable

Result: GRqG

Settings
# exclusive inclusive rows x rows loops node
1. 511.947 239,168.677 ↓ 416.1 116,937 1

Nested Loop (cost=345,373.61..563,525.50 rows=281 width=195) (actual time=64,791.001..239,168.677 rows=116,937 loops=1)

2. 189.595 77,263.369 ↓ 12.7 122,052 1

Hash Join (cost=345,373.17..540,956.95 rows=9,634 width=73) (actual time=64,786.293..77,263.369 rows=122,052 loops=1)

  • Hash Cond: (prek.stotv_id = prek_stotv.stotv_id)
3. 12,293.427 77,072.040 ↑ 1.5 122,052 1

Bitmap Heap Scan on docs_post prek (cost=345,271.94..540,083.50 rows=180,234 width=65) (actual time=64,784.511..77,072.040 rows=122,052 loops=1)

  • Recheck Cond: ((docs_post_main_id IS NOT NULL) AND (dat_sost >= (('now'::cstring)::date - '1 year'::interval)) AND (dat_sost <= (('now'::cstring)::date - '1 day'::interval)))
  • Rows Removed by Index Recheck: 2,280,324
  • Filter: (doc_state = 2)
  • Rows Removed by Filter: 5,750
  • Heap Blocks: exact=19,597 lossy=196,643
4. 47.093 64,778.613 ↓ 0.0 0 1

BitmapAnd (cost=345,271.94..345,271.94 rows=180,354 width=0) (actual time=64,778.613..64,778.613 rows=0 loops=1)

5. 1,439.491 1,439.491 ↓ 1.0 883,999 1

Bitmap Index Scan on docs_post_idx2 (cost=0.00..11,353.28 rows=855,052 width=0) (actual time=1,439.490..1,439.491 rows=883,999 loops=1)

6. 63,292.029 63,292.029 ↑ 1.0 3,316,118 1

Bitmap Index Scan on docs_post_idx1 (cost=0.00..333,828.28 rows=3,325,530 width=0) (actual time=63,292.029..63,292.029 rows=3,316,118 loops=1)

  • Index Cond: ((dat_sost >= (('now'::cstring)::date - '1 year'::interval)) AND (dat_sost <= (('now'::cstring)::date - '1 day'::interval)))
7. 0.017 1.734 ↑ 1.0 24 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
8. 0.018 1.717 ↑ 1.0 24 1

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

9. 1.651 1.651 ↑ 1.0 24 1

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

  • Filter: (((priz_prekr)::text = '+'::text) OR ((priz_prekr_ispoln)::text = '+'::text))
  • Rows Removed by Filter: 424
10. 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)
11. 20,016.528 20,016.528 ↑ 1.0 1 122,052

Index Scan using docs_post_pkey on docs_post post (cost=0.43..2.17 rows=1 width=46) (actual time=0.164..0.164 rows=1 loops=122,052)

  • Index Cond: (docs_id = prek.docs_post_main_id)
  • Filter: ((ogai_sost_kod)::text = '45597'::text)
  • Rows Removed by Filter: 0
12.          

SubPlan (for Nested Loop)

13. 140,090.526 140,090.526 ↑ 1.0 1 116,937

Index Scan using decis_docs_post_id on decis (cost=0.56..2.98 rows=1 width=5) (actual time=1.196..1.198 rows=1 loops=116,937)

  • Index Cond: (docs_post_id = post.docs_id)
  • Filter: (decis_kod = '65'::numeric)
  • Rows Removed by Filter: 0
14. 1,286.307 1,286.307 ↑ 1.0 1 116,937

Index Scan using s_stotv_pkey on s_stotv stotv (cost=0.27..2.69 rows=1 width=15) (actual time=0.011..0.011 rows=1 loops=116,937)

  • Index Cond: (stotv_id = post.stotv_id)
Planning time : 0.958 ms
Execution time : 239,189.632 ms