explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bKFT

Settings
# exclusive inclusive rows x rows loops node
1. 553.289 172,501.688 ↓ 32,706.0 32,706 1

Nested Loop (cost=1.00..165,700,257.59 rows=1 width=388) (actual time=4.054..172,501.688 rows=32,706 loops=1)

2. 1,492.083 1,492.083 ↓ 1.0 489,817 1

Index Scan using profiles_member_id_index on profiles (cost=0.43..691,782.72 rows=488,704 width=388) (actual time=0.076..1,492.083 rows=489,817 loops=1)

  • Filter: (community_id = 1088)
  • Rows Removed by Filter: 2493091
3. 0.000 170,456.316 ↓ 0.0 0 489,817

Subquery Scan on ex1 (cost=0.57..337.64 rows=1 width=4) (actual time=0.348..0.348 rows=0 loops=489,817)

  • Filter: (profiles.member_id = ex1.cpn_member_id)
4. 489.817 170,456.316 ↓ 0.0 0 489,817

Unique (cost=0.57..337.62 rows=1 width=4) (actual time=0.348..0.348 rows=0 loops=489,817)

5. 16,163.961 169,966.499 ↓ 0.0 0 489,817

Group (cost=0.57..337.62 rows=1 width=4) (actual time=0.347..0.347 rows=0 loops=489,817)

  • Group Key: coupons.member_id
6. 153,802.538 153,802.538 ↓ 0.0 0 489,817

Index Scan using coupons_coupon_id_member_id_index on coupons (cost=0.57..337.62 rows=1 width=4) (actual time=0.314..0.314 rows=0 loops=489,817)

  • Index Cond: (((coupon_id)::text = ANY ('{30406,30407,30408,30409,30410,30411,30412,30413,31701,31702,31703,31704,31705,31706,31707,31708,31709,32352,32353,32354,32355,32356,32357,32358,32359,32360,32361,32864,32865,32866,32867,32868,32869,32870,33418,33419,33420,33421,33422,34224,34225,34226,34227,34228,34229,34870,34871,34872,34873,34874,34875,35479,35480,35481,35482,35483,35484,35485,35486,35487,35488,35489,35490,35491,36108}'::text[])) AND (member_id IS NOT NULL) AND (profiles.member_id = member_id))
  • Filter: (used IS NOT NULL)
  • Rows Removed by Filter: 4