explain.depesz.com

PostgreSQL's explain analyze made readable

Result: zMla

Settings
# exclusive inclusive rows x rows loops node
1. 0.266 431.617 ↑ 5.1 724 1

Nested Loop (cost=64,757.56..81,365.94 rows=3,721 width=4) (actual time=427.612..431.617 rows=724 loops=1)

2. 1.932 427.731 ↑ 4.8 724 1

HashAggregate (cost=64,757.14..64,791.94 rows=3,480 width=4) (actual time=427.577..427.731 rows=724 loops=1)

  • Group Key: sp.contragent_id
3. 63.065 425.799 ↓ 1.5 10,728 1

Hash Right Join (cost=52,413.59..64,739.11 rows=7,212 width=4) (actual time=328.849..425.799 rows=10,728 loops=1)

  • Hash Cond: (spr.position_id = sp.id)
  • Filter: ((spr.region_code IS NULL) OR ((spr.region_code)::text = '03000000000'::text))
  • Rows Removed by Filter: 4753
4. 35.219 35.219 ↑ 1.0 522,011 1

Seq Scan on nsi_supplier_position_regions spr (cost=0.00..8,552.28 rows=522,328 width=15) (actual time=0.004..35.219 rows=522,011 loops=1)

5. 4.035 327.515 ↑ 13.9 12,433 1

Hash (cost=50,258.54..50,258.54 rows=172,404 width=8) (actual time=327.515..327.515 rows=12,433 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 2534kB
6. 98.244 323.480 ↑ 13.9 12,433 1

Hash Join (cost=3,509.35..50,258.54 rows=172,404 width=8) (actual time=9.983..323.480 rows=12,433 loops=1)

  • Hash Cond: (sp.dictionary_position_id = dpc1.dictionary_position_id)
7. 216.180 216.180 ↓ 1.0 581,788 1

Seq Scan on nsi_supplier_position sp (cost=0.00..42,849.55 rows=580,158 width=12) (actual time=0.006..216.180 rows=581,788 loops=1)

  • Filter: (is_actual AND (NOT deleted))
  • Rows Removed by Filter: 38565
8. 1.782 9.056 ↑ 21.1 11,959 1

Hash (cost=350.65..350.65 rows=252,696 width=4) (actual time=9.056..9.056 rows=11,959 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 2469kB
9. 1.907 7.274 ↑ 21.1 11,959 1

Nested Loop (cost=221.03..350.65 rows=252,696 width=4) (actual time=0.184..7.274 rows=11,959 loops=1)

10. 0.011 0.159 ↑ 1.2 12 1

HashAggregate (cost=220.60..220.74 rows=14 width=8) (actual time=0.154..0.159 rows=12 loops=1)

  • Group Key: (dpc2.category_code)::text
11. 0.003 0.148 ↓ 1.4 20 1

Nested Loop (cost=0.85..220.57 rows=14 width=8) (actual time=0.025..0.148 rows=20 loops=1)

12. 0.025 0.025 ↑ 1.1 20 1

Index Scan using nsi_price_order_positions_order_id_idx_btree on nsi_price_order_positions pop (cost=0.42..26.16 rows=23 width=4) (actual time=0.014..0.025 rows=20 loops=1)

  • Index Cond: (price_order_id = 87813)
13. 0.120 0.120 ↑ 1.0 1 20

Index Scan using nsi_dictionary_position_category_dictionary_position_id_idx on nsi_dictionary_position_category dpc2 (cost=0.42..8.44 rows=1 width=12) (actual time=0.005..0.006 rows=1 loops=20)

  • Index Cond: (dictionary_position_id = pop.dictionary_position_id)
14. 5.208 5.208 ↓ 7.3 997 12

Index Scan using nsi_dictionary_position_category_category_code_idx on nsi_dictionary_position_category dpc1 (cost=0.42..7.91 rows=137 width=12) (actual time=0.015..0.434 rows=997 loops=12)

  • Index Cond: ((category_code)::text = (dpc2.category_code)::text)
15. 3.620 3.620 ↑ 1.0 1 724

Index Only Scan using contragents_pkey on contragents c (cost=0.42..4.75 rows=1 width=4) (actual time=0.005..0.005 rows=1 loops=724)

  • Index Cond: (id = sp.contragent_id)
  • Filter: (id <> 11917)
  • Heap Fetches: 726