explain.depesz.com

PostgreSQL's explain analyze made readable

Result: a8ia

Settings
# exclusive inclusive rows x rows loops node
1. 0.578 2,143.824 ↑ 1.0 1,000 1

Limit (cost=0.56..463,242.05 rows=1,000 width=101) (actual time=6.932..2,143.824 rows=1,000 loops=1)

2. 2,105.246 2,143.246 ↑ 53,672.7 1,000 1

Index Scan using item_catalogue_pkey on item_catalogue ic (cost=0.56..24,863,420,082.97 rows=53,672,698 width=101) (actual time=6.931..2,143.246 rows=1,000 loops=1)

  • Index Cond: (id > 0)
  • Filter: ((itemtype = 2) AND (status = 1))
  • Rows Removed by Filter: 77,256
3.          

SubPlan (for Index Scan)

4. 2.000 23.000 ↑ 1.0 1 1,000

Aggregate (cost=231.51..231.52 rows=1 width=8) (actual time=0.022..0.023 rows=1 loops=1,000)

5. 2.628 21.000 ↓ 0.0 0 1,000

Nested Loop (cost=0.86..231.51 rows=1 width=8) (actual time=0.021..0.021 rows=0 loops=1,000)

6. 16.000 16.000 ↑ 27.0 1 1,000

Index Scan using idx_item_merchant_itemid_status on item_merchant im (cost=0.57..72.93 rows=27 width=12) (actual time=0.014..0.016 rows=1 loops=1,000)

  • Index Cond: ((itemid = ic.id) AND (status = ANY ('{0,1}'::bigint[])))
7. 2.372 2.372 ↓ 0.0 0 593

Index Scan using merchant_id_key on merchant m (cost=0.29..5.86 rows=1 width=8) (actual time=0.004..0.004 rows=0 loops=593)

  • Index Cond: (id = im.merchantid)
  • Filter: (status = 'A'::bpchar)
  • Rows Removed by Filter: 1
8. 1.000 15.000 ↑ 1.0 1 1,000

Aggregate (cost=231.57..231.58 rows=1 width=8) (actual time=0.015..0.015 rows=1 loops=1,000)

9. 1.814 14.000 ↓ 0.0 0 1,000

Nested Loop (cost=0.86..231.57 rows=1 width=8) (actual time=0.014..0.014 rows=0 loops=1,000)

10. 11.000 11.000 ↑ 27.0 1 1,000

Index Scan using idx_item_merchant_itemid_status_priceplustax on item_merchant im_1 (cost=0.57..73.00 rows=27 width=12) (actual time=0.010..0.011 rows=1 loops=1,000)

  • Index Cond: ((itemid = ic.id) AND (status = ANY ('{0,1}'::bigint[])) AND (priceplustax > 0::double precision))
11. 1.186 1.186 ↓ 0.0 0 593

Index Scan using merchant_id_key on merchant m_1 (cost=0.29..5.86 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=593)

  • Index Cond: (id = im_1.merchantid)
  • Filter: (status = 'A'::bpchar)
  • Rows Removed by Filter: 1