explain.depesz.com

PostgreSQL's explain analyze made readable

Result: B4GF

Settings
# exclusive inclusive rows x rows loops node
1. 0.053 18,054.626 ↑ 1.0 722 1

Limit (cost=121,597.27..121,599.07 rows=722 width=287) (actual time=18,054.528..18,054.626 rows=722 loops=1)

  • Buffers: shared hit=17,173,457 read=270,163 dirtied=8,178
2. 327.441 18,054.573 ↑ 1.6 722 1

Sort (cost=121,597.27..121,600.15 rows=1,152 width=287) (actual time=18,054.527..18,054.573 rows=722 loops=1)

  • Sort Key: store.name
  • Sort Method: top-N heapsort Memory: 637kB
  • Buffers: shared hit=17,173,457 read=270,163 dirtied=8,178
3. 112.478 17,727.132 ↓ 413.9 476,840 1

Nested Loop (cost=2.83..121,538.69 rows=1,152 width=287) (actual time=5.467..17,727.132 rows=476,840 loops=1)

  • Buffers: shared hit=17,173,457 read=270,163 dirtied=8,178
4. 207.199 16,184.134 ↓ 413.6 476,840 1

Nested Loop (cost=2.41..120,780.75 rows=1,153 width=252) (actual time=5.450..16,184.134 rows=476,840 loops=1)

  • Buffers: shared hit=15,310,707 read=224,076 dirtied=8,178
5. 98.728 13,115.895 ↓ 349.3 476,840 1

Nested Loop (cost=1.98..119,566.60 rows=1,365 width=257) (actual time=4.830..13,115.895 rows=476,840 loops=1)

  • Buffers: shared hit=13,447,041 read=177,456 dirtied=8,068
6. 921.752 10,958.895 ↓ 387.8 1,029,136 1

Nested Loop (cost=1.55..118,048.48 rows=2,654 width=184) (actual time=4.211..10,958.895 rows=1,029,136 loops=1)

  • Join Filter: (ct.merchant_id = store.id)
  • Buffers: shared hit=9,858,446 read=159,354 dirtied=7,854
7. 0.000 7,660.447 ↓ 330.6 1,188,348 1

Nested Loop (cost=1.12..115,532.17 rows=3,595 width=78) (actual time=1.645..7,660.447 rows=1,188,348 loops=1)

  • Buffers: shared hit=5,338,107 read=78,129 dirtied=7,853
8. 129.872 3,061.513 ↓ 125.8 1,193,247 1

Nested Loop (cost=0.70..109,188.35 rows=9,484 width=35) (actual time=1.126..3,061.513 rows=1,193,247 loops=1)

  • Buffers: shared hit=551,286 read=22,281 dirtied=3
9. 0.093 0.093 ↑ 1.0 68 1

Index Scan using group_id_idx on "group" gp (cost=0.14..141.28 rows=68 width=35) (actual time=0.011..0.093 rows=68 loops=1)

  • Buffers: shared hit=31 read=3
10. 2,931.548 2,931.548 ↓ 3.4 17,548 68

Index Only Scan using rel_group_store_pkey on rel_group_store rel (cost=0.56..1,085.13 rows=5,185 width=32) (actual time=0.487..43.111 rows=17,548 loops=68)

  • Index Cond: (group_id = gp.id)
  • Heap Fetches: 555,415
  • Buffers: shared hit=551,255 read=22,278 dirtied=3
11. 4,772.988 4,772.988 ↑ 1.0 1 1,193,247

Index Scan using merchant_contacts_merchant_id_idx on merchant_contacts ct (cost=0.43..0.57 rows=1 width=43) (actual time=0.003..0.004 rows=1 loops=1,193,247)

  • Index Cond: (merchant_id = rel.store_id)
  • Filter: (removed IS FALSE)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=4,786,821 read=55,848 dirtied=7,850
12. 2,376.696 2,376.696 ↑ 1.0 1 1,188,348

Index Scan using merchant_stores_id_idx1 on merchant_stores store (cost=0.42..0.60 rows=1 width=106) (actual time=0.002..0.002 rows=1 loops=1,188,348)

  • Index Cond: (id = rel.store_id)
  • Buffers: shared hit=4,520,339 read=81,225 dirtied=1
13. 2,058.272 2,058.272 ↓ 0.0 0 1,029,136

Index Scan using resources_merchant_id_index on merchant_resources resource (cost=0.42..0.57 rows=1 width=73) (actual time=0.002..0.002 rows=0 loops=1,029,136)

  • Index Cond: (merchant_id = store.id)
  • Filter: (type = 2)
  • Rows Removed by Filter: 0
  • Buffers: shared hit=3,588,595 read=18,102 dirtied=214
14. 2,861.040 2,861.040 ↑ 1.0 1 476,840

Index Scan using merchant_phones_contact_id_index on merchant_phones phone (cost=0.43..0.79 rows=1 width=27) (actual time=0.006..0.006 rows=1 loops=476,840)

  • Index Cond: (contact_id = ct.id)
  • Buffers: shared hit=1,863,666 read=46,620 dirtied=110
15. 1,430.520 1,430.520 ↑ 1.0 1 476,840

Index Scan using merchant_address_pkey on merchant_addresses address (cost=0.43..0.66 rows=1 width=99) (actual time=0.003..0.003 rows=1 loops=476,840)

  • Index Cond: (id = store.id)
  • Buffers: shared hit=1,862,750 read=46,087
Planning time : 9.159 ms
Execution time : 18,054.773 ms