explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9A6U

Settings
# exclusive inclusive rows x rows loops node
1. 0.306 23,474.597 ↓ 5.1 162 1

Hash Left Join (cost=23,645.30..48,711.27 rows=32 width=255) (actual time=1,609.436..23,474.597 rows=162 loops=1)

  • Hash Cond: (atd.id = mt.taotlus_dokument_id)
2. 23.798 23,469.790 ↓ 5.1 162 1

Hash Left Join (cost=23,482.61..48,548.41 rows=32 width=251) (actual time=1,604.881..23,469.790 rows=162 loops=1)

  • Hash Cond: ((atd.id = tkr.taotlus_dokument_id) AND ((SubPlan 1) = tkr.id))
3. 1.693 8.845 ↓ 5.1 162 1

Nested Loop (cost=0.29..1,263.71 rows=32 width=226) (actual time=1.304..8.845 rows=162 loops=1)

4. 2.136 2.136 ↓ 9.5 456 1

Seq Scan on at_taotlustoimik at (cost=0.00..425.28 rows=48 width=91) (actual time=1.199..2.136 rows=456 loops=1)

  • Filter: ((taotlusvoor_id = '33'::bigint) AND ((meede_kood)::text = '4.1'::text))
  • Rows Removed by Filter: 8672
5. 5.016 5.016 ↓ 0.0 0 456

Index Scan using at_taotlus_dokument_taotlustoimik_id_idx on at_taotlus_dokument atd (cost=0.29..17.46 rows=1 width=143) (actual time=0.009..0.011 rows=0 loops=456)

  • Index Cond: (taotlustoimik_id = at.id)
  • Filter: (((esitamis_aeg IS NOT NULL) OR ((dokument_saabumis_viis_klf)::text = 'MATS'::text)) AND ((dokument_liik_klf)::text = 'TAOTLUS'::text) AND ((dokument_alam_liik_klf)::text = 'TOETUSTAOTLUS'::text) AND (((ihs_taotlus_liik_klf)::text IS DISTINCT FROM 'MUUDATUSTAOTLUS'::text) OR (SubPlan 2)))
  • Rows Removed by Filter: 1
6.          

SubPlan (forIndex Scan)

7. 0.000 0.000 ↓ 0.0 0

Index Only Scan using at_taotlus_dokument_sisu_taotlus_dokument_id_idx on at_taotlus_dokument_sisu atds (cost=0.42..12.13 rows=13 width=0) (never executed)

  • Index Cond: (taotlus_dokument_id = atd.id)
  • Heap Fetches: 0
8. 173.355 362.839 ↑ 1.1 270,305 1

Hash (cost=16,518.33..16,518.33 rows=292,733 width=41) (actual time=362.839..362.839 rows=270,305 loops=1)

  • Buckets: 65536 Batches: 8 Memory Usage: 3066kB
9. 189.484 189.484 ↑ 1.1 270,305 1

Seq Scan on taotlus_kontroll_ring tkr (cost=0.00..16,518.33 rows=292,733 width=41) (actual time=0.010..189.484 rows=270,305 loops=1)

10.          

SubPlan (forHash Left Join)

11. 0.324 23,074.308 ↓ 0.0 0 162

Limit (cost=0.42..13,267.00 rows=1 width=8) (actual time=142.434..142.434 rows=0 loops=162)

12. 23,073.984 23,073.984 ↓ 0.0 0 162

Index Scan Backward using taotlus_kontroll_ring_id_pk on taotlus_kontroll_ring tkr_sub (cost=0.42..66,333.33 rows=5 width=8) (actual time=142.432..142.432 rows=0 loops=162)

  • Filter: (on_ametlik AND ((kontrollija_liik_klf)::text <> 'SYSTEEM'::text) AND (atd.id = taotlus_dokument_id) AND ((kontroll_ring_liik_klf)::text = 'HALDUSKONTROLL'::text))
  • Rows Removed by Filter: 270305
13. 2.156 4.501 ↓ 1.1 4,072 1

Hash (cost=114.53..114.53 rows=3,853 width=12) (actual time=4.500..4.501 rows=4,072 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 192kB
14. 2.345 2.345 ↓ 1.1 4,072 1

Seq Scan on maksetaotlus mt (cost=0.00..114.53 rows=3,853 width=12) (actual time=0.019..2.345 rows=4,072 loops=1)